misskey/packages/backend/src/models/Emoji.ts
anatawa12 6f6fdfe28e
Migration cleanup (#16288)
* chore: apply several @Index and @ManyToOne to match actual migration code

* chore: several decorator updates with typeorm bug workaround with patches

* feat: add final cleanup migration

* dev: add .editorconfig settings for generated migrations

* chore: update dockerfile to build package with patches

* chore: update federation test compose to include patches

* chore: revert few dependency update

* chore: don't check disableRegistration on test env

* test: add test for checking migration script

* chore: set proxyRemoteFiles true in test config

* chore: enter invitation code in signup test

* fix: register send button is not disabled when invitationCode is not input
2025-07-16 15:49:05 +09:00

86 lines
1.7 KiB
TypeScript

/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* 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 })
@Index('IDX_EMOJI_ROLE_IDS', { synchronize: false }) // GIN for roleIdsThatCanBeUsedThisEmojiAsReaction in production
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,
})
@Index('IDX_EMOJI_CATEGORY')
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[];
}