summaryrefslogtreecommitdiff
path: root/packages/backend/src/models/Emoji.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/src/models/Emoji.ts')
-rw-r--r--packages/backend/src/models/Emoji.ts84
1 files changed, 84 insertions, 0 deletions
diff --git a/packages/backend/src/models/Emoji.ts b/packages/backend/src/models/Emoji.ts
new file mode 100644
index 0000000000..563ac1d9d3
--- /dev/null
+++ b/packages/backend/src/models/Emoji.ts
@@ -0,0 +1,84 @@
+/*
+ * SPDX-FileCopyrightText: syuilo and other misskey contributors
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+
+import { PrimaryColumn, Entity, Index, Column } from 'typeorm';
+import { id } from './util/id.js';
+
+@Entity('emoji')
+@Index(['name', 'host'], { unique: true })
+export class MiEmoji {
+ @PrimaryColumn(id())
+ public id: string;
+
+ @Column('timestamp with time zone', {
+ nullable: true,
+ })
+ public updatedAt: Date | null;
+
+ @Index()
+ @Column('varchar', {
+ length: 128,
+ })
+ public name: string;
+
+ @Index()
+ @Column('varchar', {
+ length: 128, nullable: true,
+ })
+ public host: string | null;
+
+ @Column('varchar', {
+ length: 128, nullable: true,
+ })
+ public category: string | null;
+
+ @Column('varchar', {
+ length: 512,
+ })
+ public originalUrl: string;
+
+ @Column('varchar', {
+ length: 512,
+ default: '',
+ })
+ public publicUrl: string;
+
+ @Column('varchar', {
+ length: 512, nullable: true,
+ })
+ public uri: string | null;
+
+ // publicUrlの方のtypeが入る
+ @Column('varchar', {
+ length: 64, nullable: true,
+ })
+ public type: string | null;
+
+ @Column('varchar', {
+ array: true, length: 128, default: '{}',
+ })
+ public aliases: string[];
+
+ @Column('varchar', {
+ length: 1024, nullable: true,
+ })
+ public license: string | null;
+
+ @Column('boolean', {
+ default: false,
+ })
+ public localOnly: boolean;
+
+ @Column('boolean', {
+ default: false,
+ })
+ public isSensitive: boolean;
+
+ // TODO: 定期ジョブで存在しなくなったロールIDを除去するようにする
+ @Column('varchar', {
+ array: true, length: 128, default: '{}',
+ })
+ public roleIdsThatCanBeUsedThisEmojiAsReaction: string[];
+}