From 4e6439763544f7b96009dd1411035343fb561d2a Mon Sep 17 00:00:00 2001 From: Mar0xy Date: Fri, 6 Oct 2023 02:32:09 +0200 Subject: add: profile backgrounds --- packages/backend/src/models/User.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'packages/backend/src/models/User.ts') diff --git a/packages/backend/src/models/User.ts b/packages/backend/src/models/User.ts index 08c8243421..c5670f635b 100644 --- a/packages/backend/src/models/User.ts +++ b/packages/backend/src/models/User.ts @@ -124,6 +124,19 @@ export class MiUser { @JoinColumn() public banner: MiDriveFile | null; + @Column({ + ...id(), + nullable: true, + comment: 'The ID of background DriveFile.', + }) + public backgroundId: MiDriveFile['id'] | null; + + @OneToOne(type => MiDriveFile, { + onDelete: 'SET NULL', + }) + @JoinColumn() + public background: MiDriveFile | null; + @Column('varchar', { length: 512, nullable: true, }) @@ -134,6 +147,11 @@ export class MiUser { }) public bannerUrl: string | null; + @Column('varchar', { + length: 512, nullable: true, + }) + public backgroundUrl: string | null; + @Column('varchar', { length: 128, nullable: true, }) @@ -144,6 +162,11 @@ export class MiUser { }) public bannerBlurhash: string | null; + @Column('varchar', { + length: 128, nullable: true, + }) + public backgroundBlurhash: string | null; + @Index() @Column('varchar', { length: 128, array: true, default: '{}', -- cgit v1.2.3-freya