chore: synchronize code and database schema (#8577)
* chore: remove default null null is always the default value if a table column is nullable, and typeorm's @Column only accepts strings for default. * chore: synchronize code with database schema * chore: sync generated migrations with code
This commit is contained in:
@ -15,7 +15,6 @@ export class AccessToken {
|
||||
|
||||
@Column('timestamp with time zone', {
|
||||
nullable: true,
|
||||
default: null,
|
||||
})
|
||||
public lastUsedAt: Date | null;
|
||||
|
||||
@ -29,7 +28,6 @@ export class AccessToken {
|
||||
@Column('varchar', {
|
||||
length: 128,
|
||||
nullable: true,
|
||||
default: null,
|
||||
})
|
||||
public session: string | null;
|
||||
|
||||
@ -52,7 +50,6 @@ export class AccessToken {
|
||||
@Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
default: null,
|
||||
})
|
||||
public appId: App['id'] | null;
|
||||
|
||||
@ -65,21 +62,18 @@ export class AccessToken {
|
||||
@Column('varchar', {
|
||||
length: 128,
|
||||
nullable: true,
|
||||
default: null,
|
||||
})
|
||||
public name: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
default: null,
|
||||
})
|
||||
public description: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
default: null,
|
||||
})
|
||||
public iconUrl: string | null;
|
||||
|
||||
|
@ -23,7 +23,7 @@ export class AuthSession {
|
||||
...id(),
|
||||
nullable: true,
|
||||
})
|
||||
public userId: User['id'];
|
||||
public userId: User['id'] | null;
|
||||
|
||||
@ManyToOne(type => User, {
|
||||
onDelete: 'CASCADE',
|
||||
|
@ -37,7 +37,7 @@ export class Clip {
|
||||
public isPublic: boolean;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 2048, nullable: true, default: null,
|
||||
length: 2048, nullable: true,
|
||||
comment: 'The description of the Clip.',
|
||||
})
|
||||
public description: string | null;
|
||||
|
@ -79,7 +79,6 @@ export class DriveFile {
|
||||
})
|
||||
public properties: { width?: number; height?: number; orientation?: number; avgColor?: string };
|
||||
|
||||
@Index()
|
||||
@Column('boolean')
|
||||
public storedInternal: boolean;
|
||||
|
||||
|
@ -36,6 +36,7 @@ export class Emoji {
|
||||
|
||||
@Column('varchar', {
|
||||
length: 512,
|
||||
default: '',
|
||||
})
|
||||
public publicUrl: string;
|
||||
|
||||
|
@ -107,53 +107,53 @@ export class Instance {
|
||||
public isSuspended: boolean;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 64, nullable: true, default: null,
|
||||
length: 64, nullable: true,
|
||||
comment: 'The software of the Instance.',
|
||||
})
|
||||
public softwareName: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 64, nullable: true, default: null,
|
||||
length: 64, nullable: true,
|
||||
})
|
||||
public softwareVersion: string | null;
|
||||
|
||||
@Column('boolean', {
|
||||
nullable: true, default: null,
|
||||
nullable: true,
|
||||
})
|
||||
public openRegistrations: boolean | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 256, nullable: true, default: null,
|
||||
length: 256, nullable: true,
|
||||
})
|
||||
public name: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 4096, nullable: true, default: null,
|
||||
length: 4096, nullable: true,
|
||||
})
|
||||
public description: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 128, nullable: true, default: null,
|
||||
length: 128, nullable: true,
|
||||
})
|
||||
public maintainerName: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 256, nullable: true, default: null,
|
||||
length: 256, nullable: true,
|
||||
})
|
||||
public maintainerEmail: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 256, nullable: true, default: null,
|
||||
length: 256, nullable: true,
|
||||
})
|
||||
public iconUrl: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 256, nullable: true, default: null,
|
||||
length: 256, nullable: true,
|
||||
})
|
||||
public faviconUrl: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 64, nullable: true, default: null,
|
||||
length: 64, nullable: true,
|
||||
})
|
||||
public themeColor: string | null;
|
||||
|
||||
|
@ -78,7 +78,7 @@ export class Meta {
|
||||
public blockedHosts: string[];
|
||||
|
||||
@Column('varchar', {
|
||||
length: 512, array: true, default: '{"/featured", "/channels", "/explore", "/pages", "/about-misskey"}',
|
||||
length: 512, array: true, default: '{/featured,/channels,/explore,/pages,/about-misskey}',
|
||||
})
|
||||
public pinnedPages: string[];
|
||||
|
||||
@ -346,14 +346,12 @@ export class Meta {
|
||||
|
||||
@Column('varchar', {
|
||||
length: 8192,
|
||||
default: null,
|
||||
nullable: true,
|
||||
})
|
||||
public defaultLightTheme: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 8192,
|
||||
default: null,
|
||||
nullable: true,
|
||||
})
|
||||
public defaultDarkTheme: string | null;
|
||||
|
@ -17,7 +17,6 @@ export class Muting {
|
||||
@Index()
|
||||
@Column('timestamp with time zone', {
|
||||
nullable: true,
|
||||
default: null,
|
||||
})
|
||||
public expiresAt: Date | null;
|
||||
|
||||
|
@ -53,8 +53,8 @@ export class Note {
|
||||
})
|
||||
public threadId: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 8192, nullable: true,
|
||||
@Column('text', {
|
||||
nullable: true,
|
||||
})
|
||||
public text: string | null;
|
||||
|
||||
@ -179,7 +179,7 @@ export class Note {
|
||||
@Index()
|
||||
@Column({
|
||||
...id(),
|
||||
nullable: true, default: null,
|
||||
nullable: true,
|
||||
comment: 'The ID of source channel.',
|
||||
})
|
||||
public channelId: Channel['id'] | null;
|
||||
|
@ -192,6 +192,7 @@ export class UserProfile {
|
||||
|
||||
@Column('jsonb', {
|
||||
default: [],
|
||||
comment: 'List of instances muted by the user.',
|
||||
})
|
||||
public mutedInstances: string[];
|
||||
|
||||
|
@ -207,7 +207,7 @@ export class User {
|
||||
|
||||
@Column('boolean', {
|
||||
default: false,
|
||||
comment: 'Whether to show users replying to other users in the timeline',
|
||||
comment: 'Whether to show users replying to other users in the timeline.',
|
||||
})
|
||||
public showTimelineReplies: boolean;
|
||||
|
||||
|
Reference in New Issue
Block a user