summaryrefslogtreecommitdiff
path: root/packages/backend/src/models/Flash.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-09-20 11:33:36 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-09-20 11:33:36 +0900
commit053da10e94c2412f58215116a958c0922261a610 (patch)
treed608ce6350d5b209178390c3ab56c1fd0d30c438 /packages/backend/src/models/Flash.ts
parentfix (diff)
downloadmisskey-053da10e94c2412f58215116a958c0922261a610.tar.gz
misskey-053da10e94c2412f58215116a958c0922261a610.tar.bz2
misskey-053da10e94c2412f58215116a958c0922261a610.zip
refactor(backend): update directory structure for models
Diffstat (limited to 'packages/backend/src/models/Flash.ts')
-rw-r--r--packages/backend/src/models/Flash.ts73
1 files changed, 73 insertions, 0 deletions
diff --git a/packages/backend/src/models/Flash.ts b/packages/backend/src/models/Flash.ts
new file mode 100644
index 0000000000..185063029d
--- /dev/null
+++ b/packages/backend/src/models/Flash.ts
@@ -0,0 +1,73 @@
+/*
+ * SPDX-FileCopyrightText: syuilo and other misskey contributors
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+
+import { Entity, Index, JoinColumn, Column, PrimaryColumn, ManyToOne } from 'typeorm';
+import { id } from './util/id.js';
+import { MiUser } from './User.js';
+
+@Entity('flash')
+export class MiFlash {
+ @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.',
+ })
+ public userId: MiUser['id'];
+
+ @ManyToOne(type => MiUser, {
+ onDelete: 'CASCADE',
+ })
+ @JoinColumn()
+ public user: MiUser | null;
+
+ @Column('varchar', {
+ length: 65536,
+ })
+ public script: string;
+
+ @Column('varchar', {
+ length: 256, array: true, default: '{}',
+ })
+ public permissions: string[];
+
+ @Column('integer', {
+ default: 0,
+ })
+ public likedCount: number;
+
+ /**
+ * public ... 公開
+ * private ... プロフィールには表示しない
+ */
+ @Column('varchar', {
+ length: 512, default: 'public',
+ })
+ public visibility: 'public' | 'private';
+}