summaryrefslogtreecommitdiff
path: root/packages/backend/src/models
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/src/models')
-rw-r--r--packages/backend/src/models/User.ts23
-rw-r--r--packages/backend/src/models/json-schema/user.ts14
2 files changed, 37 insertions, 0 deletions
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,
})
@@ -135,6 +148,11 @@ export class MiUser {
public bannerUrl: string | null;
@Column('varchar', {
+ length: 512, nullable: true,
+ })
+ public backgroundUrl: string | null;
+
+ @Column('varchar', {
length: 128, nullable: true,
})
public avatarBlurhash: string | null;
@@ -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: '{}',
diff --git a/packages/backend/src/models/json-schema/user.ts b/packages/backend/src/models/json-schema/user.ts
index a8fb34acb1..bea2922f5a 100644
--- a/packages/backend/src/models/json-schema/user.ts
+++ b/packages/backend/src/models/json-schema/user.ts
@@ -122,6 +122,15 @@ export const packedUserDetailedNotMeOnlySchema = {
type: 'string',
nullable: true, optional: false,
},
+ backgroundUrl: {
+ type: 'string',
+ format: 'url',
+ nullable: true, optional: false,
+ },
+ backgroundBlurhash: {
+ type: 'string',
+ nullable: true, optional: false,
+ },
isLocked: {
type: 'boolean',
nullable: false, optional: false,
@@ -304,6 +313,11 @@ export const packedMeDetailedOnlySchema = {
nullable: true, optional: false,
format: 'id',
},
+ backgroundId: {
+ type: 'string',
+ nullable: true, optional: false,
+ format: 'id',
+ },
injectFeaturedNote: {
type: 'boolean',
nullable: true, optional: false,