2023-07-27 14:31:52 +09:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2023-01-05 13:59:48 +09:00
|
|
|
import { Entity, Index, JoinColumn, Column, PrimaryColumn, ManyToOne } from 'typeorm';
|
|
|
|
import { id } from '../id.js';
|
2023-08-16 17:51:28 +09:00
|
|
|
import { MiUser } from './User.js';
|
2023-01-05 13:59:48 +09:00
|
|
|
|
2023-08-16 17:51:28 +09:00
|
|
|
@Entity('flash')
|
|
|
|
export class MiFlash {
|
2023-01-05 13:59:48 +09:00
|
|
|
@PrimaryColumn(id())
|
|
|
|
public id: string;
|
|
|
|
|
|
|
|
@Index()
|
|
|
|
@Column('timestamp with time zone', {
|
|
|
|
comment: 'The created date of the Flash.',
|
|
|
|
})
|
|
|
|
public createdAt: Date;
|
|
|
|
|
|
|
|
@Index()
|
|
|
|
@Column('timestamp with time zone', {
|
|
|
|
comment: 'The updated date of the Flash.',
|
|
|
|
})
|
|
|
|
public updatedAt: Date;
|
|
|
|
|
|
|
|
@Column('varchar', {
|
|
|
|
length: 256,
|
|
|
|
})
|
|
|
|
public title: string;
|
|
|
|
|
|
|
|
@Column('varchar', {
|
|
|
|
length: 1024,
|
|
|
|
})
|
|
|
|
public summary: string;
|
|
|
|
|
|
|
|
@Index()
|
|
|
|
@Column({
|
|
|
|
...id(),
|
|
|
|
comment: 'The ID of author.',
|
|
|
|
})
|
2023-08-16 17:51:28 +09:00
|
|
|
public userId: MiUser['id'];
|
2023-01-05 13:59:48 +09:00
|
|
|
|
2023-08-16 17:51:28 +09:00
|
|
|
@ManyToOne(type => MiUser, {
|
2023-01-05 13:59:48 +09:00
|
|
|
onDelete: 'CASCADE',
|
|
|
|
})
|
|
|
|
@JoinColumn()
|
2023-08-16 17:51:28 +09:00
|
|
|
public user: MiUser | null;
|
2023-01-05 13:59:48 +09:00
|
|
|
|
|
|
|
@Column('varchar', {
|
2023-03-10 14:53:56 +09:00
|
|
|
length: 65536,
|
2023-01-05 13:59:48 +09:00
|
|
|
})
|
|
|
|
public script: string;
|
|
|
|
|
|
|
|
@Column('varchar', {
|
|
|
|
length: 256, array: true, default: '{}',
|
|
|
|
})
|
|
|
|
public permissions: string[];
|
|
|
|
|
|
|
|
@Column('integer', {
|
|
|
|
default: 0,
|
|
|
|
})
|
|
|
|
public likedCount: number;
|
|
|
|
}
|