mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-03-23 12:33:38 +00:00
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
This commit is contained in:
@@ -22,7 +22,7 @@ export class MiAbuseReportNotificationRecipient {
|
||||
/**
|
||||
* 有効かどうか.
|
||||
*/
|
||||
@Index()
|
||||
@Index('IDX_abuse_report_notification_recipient_isActive')
|
||||
@Column('boolean', {
|
||||
default: true,
|
||||
})
|
||||
@@ -47,7 +47,7 @@ export class MiAbuseReportNotificationRecipient {
|
||||
/**
|
||||
* 通知方法.
|
||||
*/
|
||||
@Index()
|
||||
@Index('IDX_abuse_report_notification_recipient_method')
|
||||
@Column('varchar', {
|
||||
length: 64,
|
||||
})
|
||||
@@ -56,10 +56,11 @@ export class MiAbuseReportNotificationRecipient {
|
||||
/**
|
||||
* 通知先のユーザID.
|
||||
*/
|
||||
@Index()
|
||||
@Index('IDX_abuse_report_notification_recipient_userId')
|
||||
@Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
default: null,
|
||||
})
|
||||
public userId: MiUser['id'] | null;
|
||||
|
||||
@@ -75,17 +76,20 @@ export class MiAbuseReportNotificationRecipient {
|
||||
/**
|
||||
* 通知先のユーザプロフィール.
|
||||
*/
|
||||
@ManyToOne(type => MiUserProfile, {})
|
||||
@ManyToOne(type => MiUserProfile, {
|
||||
onDelete: 'CASCADE',
|
||||
})
|
||||
@JoinColumn({ name: 'userId', referencedColumnName: 'userId', foreignKeyConstraintName: 'FK_abuse_report_notification_recipient_userId2' })
|
||||
public userProfile: MiUserProfile | null;
|
||||
|
||||
/**
|
||||
* 通知先のシステムWebhookId.
|
||||
*/
|
||||
@Index()
|
||||
@Index('IDX_abuse_report_notification_recipient_systemWebhookId')
|
||||
@Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
default: null,
|
||||
})
|
||||
public systemWebhookId: string | null;
|
||||
|
||||
@@ -95,6 +99,6 @@ export class MiAbuseReportNotificationRecipient {
|
||||
@ManyToOne(type => MiSystemWebhook, {
|
||||
onDelete: 'CASCADE',
|
||||
})
|
||||
@JoinColumn()
|
||||
@JoinColumn({ name: 'systemWebhookId', referencedColumnName: 'id', foreignKeyConstraintName: 'FK_abuse_report_notification_recipient_systemWebhookId' })
|
||||
public systemWebhook: MiSystemWebhook | null;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ 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;
|
||||
@@ -32,6 +33,7 @@ export class MiEmoji {
|
||||
@Column('varchar', {
|
||||
length: 128, nullable: true,
|
||||
})
|
||||
@Index('IDX_EMOJI_CATEGORY')
|
||||
public category: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
|
||||
@@ -59,7 +59,7 @@ export class MiMeta {
|
||||
public maintainerEmail: string | null;
|
||||
|
||||
@Column('boolean', {
|
||||
default: false,
|
||||
default: true,
|
||||
})
|
||||
public disableRegistration: boolean;
|
||||
|
||||
@@ -570,7 +570,7 @@ export class MiMeta {
|
||||
public bannedEmailDomains: string[];
|
||||
|
||||
@Column('varchar', {
|
||||
length: 1024, array: true, default: '{ "admin", "administrator", "root", "system", "maintainer", "host", "mod", "moderator", "owner", "superuser", "staff", "auth", "i", "me", "everyone", "all", "mention", "mentions", "example", "user", "users", "account", "accounts", "official", "help", "helps", "support", "supports", "info", "information", "informations", "announce", "announces", "announcement", "announcements", "notice", "notification", "notifications", "dev", "developer", "developers", "tech", "misskey" }',
|
||||
length: 1024, array: true, default: ['admin', 'administrator', 'root', 'system', 'maintainer', 'host', 'mod', 'moderator', 'owner', 'superuser', 'staff', 'auth', 'i', 'me', 'everyone', 'all', 'mention', 'mentions', 'example', 'user', 'users', 'account', 'accounts', 'official', 'help', 'helps', 'support', 'supports', 'info', 'information', 'informations', 'announce', 'announces', 'announcement', 'announcements', 'notice', 'notification', 'notifications', 'dev', 'developer', 'developers', 'tech', 'misskey'],
|
||||
})
|
||||
public preservedUsernames: string[];
|
||||
|
||||
@@ -635,7 +635,7 @@ export class MiMeta {
|
||||
public urlPreviewMaximumContentLength: number;
|
||||
|
||||
@Column('boolean', {
|
||||
default: true,
|
||||
default: false,
|
||||
})
|
||||
public urlPreviewRequireContentLength: boolean;
|
||||
|
||||
@@ -648,6 +648,7 @@ export class MiMeta {
|
||||
@Column('varchar', {
|
||||
length: 1024,
|
||||
nullable: true,
|
||||
default: null,
|
||||
})
|
||||
public urlPreviewUserAgent: string | null;
|
||||
|
||||
|
||||
@@ -20,7 +20,8 @@ import type { MiDriveFile } from './DriveFile.js';
|
||||
// You should not use `@Index({ concurrent: true })` decorator because database initialization for test will fail
|
||||
// because it will always run CREATE INDEX in transaction based on decorators.
|
||||
// Not appending `{ concurrent: true }` to `@Index` will not cause any problem in production,
|
||||
@Index(['userId', 'id'])
|
||||
|
||||
@Index(['userId', 'id']) // Note: this index is ("userId", "id" DESC) in production, but not in test.
|
||||
@Entity('note')
|
||||
export class MiNote {
|
||||
@PrimaryColumn(id())
|
||||
|
||||
@@ -12,11 +12,13 @@ import { MiNote } from './Note.js';
|
||||
import type { MiDriveFile } from './DriveFile.js';
|
||||
|
||||
@Entity('note_draft')
|
||||
@Index('IDX_NOTE_DRAFT_FILE_IDS', { synchronize: false }) // GIN for fileIds in production
|
||||
@Index('IDX_NOTE_DRAFT_VISIBLE_USER_IDS', { synchronize: false }) // GIN for visibleUserIds in production
|
||||
export class MiNoteDraft {
|
||||
@PrimaryColumn(id())
|
||||
public id: string;
|
||||
|
||||
@Index()
|
||||
@Index('IDX_NOTE_DRAFT_REPLY_ID')
|
||||
@Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
@@ -31,7 +33,7 @@ export class MiNoteDraft {
|
||||
@JoinColumn()
|
||||
public reply: MiNote | null;
|
||||
|
||||
@Index()
|
||||
@Index('IDX_NOTE_DRAFT_RENOTE_ID')
|
||||
@Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
@@ -57,7 +59,7 @@ export class MiNoteDraft {
|
||||
})
|
||||
public cw: string | null;
|
||||
|
||||
@Index()
|
||||
@Index('IDX_NOTE_DRAFT_USER_ID')
|
||||
@Column({
|
||||
...id(),
|
||||
comment: 'The ID of author.',
|
||||
@@ -108,7 +110,7 @@ export class MiNoteDraft {
|
||||
})
|
||||
public hashtag: string | null;
|
||||
|
||||
@Index()
|
||||
@Index('IDX_NOTE_DRAFT_CHANNEL_ID')
|
||||
@Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
|
||||
@@ -29,7 +29,7 @@ export class MiUserProfile {
|
||||
})
|
||||
public location: string | null;
|
||||
|
||||
@Index()
|
||||
// Note: There's index named IDX_de22cd2b445eee31ae51cdbe99 for SUBSTR("birthday", 6, 5)
|
||||
@Column('char', {
|
||||
length: 10, nullable: true,
|
||||
comment: 'The birthday (YYYY-MM-DD) of the User.',
|
||||
|
||||
Reference in New Issue
Block a user