merge: Synchronize database entities and code models (!1040)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1040 Approved-by: dakkar <dakkar@thenautilus.net> Approved-by: Marie <github@yuugi.dev>
This commit is contained in:
commit
e59a3ad693
21 changed files with 214 additions and 25 deletions
|
|
@ -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,7 +56,7 @@ export class MiAbuseReportNotificationRecipient {
|
|||
/**
|
||||
* 通知先のユーザID.
|
||||
*/
|
||||
@Index()
|
||||
@Index('IDX_abuse_report_notification_recipient_userId')
|
||||
@Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
|
|
@ -75,14 +75,16 @@ 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,
|
||||
|
|
@ -95,6 +97,8 @@ export class MiAbuseReportNotificationRecipient {
|
|||
@ManyToOne(type => MiSystemWebhook, {
|
||||
onDelete: 'CASCADE',
|
||||
})
|
||||
@JoinColumn()
|
||||
@JoinColumn({
|
||||
foreignKeyConstraintName: 'FK_abuse_report_notification_recipient_systemWebhookId',
|
||||
})
|
||||
public systemWebhook: MiSystemWebhook | null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ export class MiEmoji {
|
|||
})
|
||||
public host: string | null;
|
||||
|
||||
@Index('IDX_EMOJI_CATEGORY')
|
||||
@Column('varchar', {
|
||||
length: 128, nullable: true,
|
||||
})
|
||||
|
|
@ -77,6 +78,8 @@ export class MiEmoji {
|
|||
public isSensitive: boolean;
|
||||
|
||||
// TODO: 定期ジョブで存在しなくなったロールIDを除去するようにする
|
||||
// Synchronize: false is needed because TypeORM doesn't understand GIN indexes
|
||||
@Index('IDX_EMOJI_ROLE_IDS', { synchronize: false })
|
||||
@Column('varchar', {
|
||||
array: true, length: 128, default: '{}',
|
||||
})
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ export class SkLatestNote {
|
|||
})
|
||||
@JoinColumn({
|
||||
name: 'user_id',
|
||||
foreignKeyConstraintName: 'FK_20e346fffe4a2174585005d6d80',
|
||||
})
|
||||
public user: MiUser | null;
|
||||
|
||||
|
|
@ -60,6 +61,7 @@ export class SkLatestNote {
|
|||
})
|
||||
@JoinColumn({
|
||||
name: 'note_id',
|
||||
foreignKeyConstraintName: 'FK_47a38b1c13de6ce4e5090fb1acd',
|
||||
})
|
||||
public note: MiNote | null;
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ export class MiMeta {
|
|||
public maintainerEmail: string | null;
|
||||
|
||||
@Column('boolean', {
|
||||
default: false,
|
||||
default: true,
|
||||
})
|
||||
public disableRegistration: boolean;
|
||||
|
||||
|
|
@ -431,7 +431,7 @@ export class MiMeta {
|
|||
@Column('varchar', {
|
||||
length: 1024,
|
||||
default: 'https://activitypub.software/TransFem-org/Sharkey/',
|
||||
nullable: false,
|
||||
nullable: true,
|
||||
})
|
||||
public repositoryUrl: string | null;
|
||||
|
||||
|
|
@ -618,8 +618,8 @@ export class MiMeta {
|
|||
})
|
||||
public enableAchievements: boolean;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 2048, nullable: true,
|
||||
@Column('text', {
|
||||
nullable: true,
|
||||
})
|
||||
public robotsTxt: string | null;
|
||||
|
||||
|
|
@ -649,7 +649,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[];
|
||||
|
||||
|
|
@ -664,22 +664,22 @@ export class MiMeta {
|
|||
public enableFanoutTimelineDbFallback: boolean;
|
||||
|
||||
@Column('integer', {
|
||||
default: 300,
|
||||
default: 800,
|
||||
})
|
||||
public perLocalUserUserTimelineCacheMax: number;
|
||||
|
||||
@Column('integer', {
|
||||
default: 100,
|
||||
default: 800,
|
||||
})
|
||||
public perRemoteUserUserTimelineCacheMax: number;
|
||||
|
||||
@Column('integer', {
|
||||
default: 300,
|
||||
default: 800,
|
||||
})
|
||||
public perUserHomeTimelineCacheMax: number;
|
||||
|
||||
@Column('integer', {
|
||||
default: 300,
|
||||
default: 800,
|
||||
})
|
||||
public perUserListTimelineCacheMax: number;
|
||||
|
||||
|
|
@ -695,9 +695,9 @@ export class MiMeta {
|
|||
|
||||
@Column('varchar', {
|
||||
length: 500,
|
||||
nullable: true,
|
||||
default: '❤️',
|
||||
})
|
||||
public defaultLike: string | null;
|
||||
public defaultLike: string;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 256, array: true, default: '{}',
|
||||
|
|
@ -720,7 +720,7 @@ export class MiMeta {
|
|||
public urlPreviewMaximumContentLength: number;
|
||||
|
||||
@Column('boolean', {
|
||||
default: true,
|
||||
default: false,
|
||||
})
|
||||
public urlPreviewRequireContentLength: boolean;
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import { MiUser } from './User.js';
|
|||
import { MiChannel } from './Channel.js';
|
||||
import type { MiDriveFile } from './DriveFile.js';
|
||||
|
||||
@Index(['userId', 'id'])
|
||||
@Index('IDX_724b311e6f883751f261ebe378', ['userId', 'id'])
|
||||
@Entity('note')
|
||||
export class MiNote {
|
||||
@PrimaryColumn(id())
|
||||
|
|
|
|||
|
|
@ -129,7 +129,9 @@ export class MiUser {
|
|||
@OneToOne(() => MiDriveFile, {
|
||||
onDelete: 'SET NULL',
|
||||
})
|
||||
@JoinColumn()
|
||||
@JoinColumn({
|
||||
foreignKeyConstraintName: 'FK_q5lm0tbgejtfskzg0rc4wd7t1n',
|
||||
})
|
||||
public background: MiDriveFile | null;
|
||||
|
||||
// avatarId が null になったとしてもこれが null でない可能性があるため、このフィールドを使うときは avatarId の non-null チェックをすること
|
||||
|
|
@ -345,7 +347,7 @@ export class MiUser {
|
|||
*/
|
||||
@Column('boolean', {
|
||||
name: 'enable_rss',
|
||||
default: true,
|
||||
default: false,
|
||||
})
|
||||
public enableRss: boolean;
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,9 @@ export class MiUserListMembership {
|
|||
@ManyToOne(type => MiUser, {
|
||||
onDelete: 'CASCADE',
|
||||
})
|
||||
@JoinColumn()
|
||||
@JoinColumn({
|
||||
foreignKeyConstraintName: 'FK_d844bfc6f3f523a05189076efaa',
|
||||
})
|
||||
public user: MiUser | null;
|
||||
|
||||
@Index()
|
||||
|
|
@ -37,7 +39,9 @@ export class MiUserListMembership {
|
|||
@ManyToOne(type => MiUserList, {
|
||||
onDelete: 'CASCADE',
|
||||
})
|
||||
@JoinColumn()
|
||||
@JoinColumn({
|
||||
foreignKeyConstraintName: 'FK_605472305f26818cc93d1baaa74',
|
||||
})
|
||||
public userList: MiUserList | null;
|
||||
|
||||
// タイムラインにその人のリプライまで含めるかどうか
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ export class MiUserPending {
|
|||
|
||||
@Column('varchar', {
|
||||
length: 1000,
|
||||
nullable: true,
|
||||
})
|
||||
public reason: string;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,12 +110,14 @@ export class MiUserProfile {
|
|||
|
||||
@Column('enum', {
|
||||
enum: followingVisibilities,
|
||||
enumName: 'user_profile_followingVisibility_enum',
|
||||
default: 'public',
|
||||
})
|
||||
public followingVisibility: typeof followingVisibilities[number];
|
||||
|
||||
@Column('enum', {
|
||||
enum: followersVisibilities,
|
||||
enumName: 'user_profile_followersVisibility_enum',
|
||||
default: 'public',
|
||||
})
|
||||
public followersVisibility: typeof followersVisibilities[number];
|
||||
|
|
|
|||
|
|
@ -481,6 +481,10 @@ export const meta = {
|
|||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
defaultLike: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
description: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ export const paramDef = {
|
|||
description: { type: 'string', nullable: true },
|
||||
defaultLightTheme: { type: 'string', nullable: true },
|
||||
defaultDarkTheme: { type: 'string', nullable: true },
|
||||
defaultLike: { type: 'string', nullable: true },
|
||||
defaultLike: { type: 'string' },
|
||||
cacheRemoteFiles: { type: 'boolean' },
|
||||
cacheRemoteSensitiveFiles: { type: 'boolean' },
|
||||
emailRequiredForSignup: { type: 'boolean' },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue