1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-07-29 19:14:36 +02:00
Files
misskey/packages/backend/src/models/PromoNote.ts
anatawa12 666f78e676 enable and fix no-unused-vars and no-async-promise-executor (#17070)
* dev: set --no-bail for lint task

* lint: enable no-async-promise-executor lint and fix them

* lint: enable no-unused-vars with allowing _ prefix

* lint: fix semi
2026-01-08 11:49:12 +09:00

34 lines
709 B
TypeScript

/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { PrimaryColumn, Entity, Index, JoinColumn, Column, OneToOne } from 'typeorm';
import { id } from './util/id.js';
import { MiNote } from './Note.js';
import type { MiUser } from './User.js';
@Entity('promo_note')
export class MiPromoNote {
@PrimaryColumn(id())
public noteId: MiNote['id'];
@OneToOne(() => MiNote, {
onDelete: 'CASCADE',
})
@JoinColumn()
public note: MiNote | null;
@Column('timestamp with time zone')
public expiresAt: Date;
//#region Denormalized fields
@Index()
@Column({
...id(),
comment: '[Denormalized]',
})
public userId: MiUser['id'];
//#endregion
}