wip
This commit is contained in:
parent
549202d0e9
commit
1d2d4ab023
3 changed files with 18 additions and 0 deletions
11
packages/backend/migration/1724078037441-vacationMode.js
Normal file
11
packages/backend/migration/1724078037441-vacationMode.js
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
export class vacationMode1724078037441 {
|
||||||
|
name = 'vacationMode1724078037441'
|
||||||
|
|
||||||
|
async up(queryRunner) {
|
||||||
|
await queryRunner.query(`ALTER TABLE "user" ADD "isVacation" boolean NOT NULL DEFAULT false`);
|
||||||
|
}
|
||||||
|
|
||||||
|
async down(queryRunner) {
|
||||||
|
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "isVacation"`);
|
||||||
|
}
|
||||||
|
}
|
|
@ -576,6 +576,7 @@ export class UserEntityService implements OnModuleInit {
|
||||||
isModerator: isModerator,
|
isModerator: isModerator,
|
||||||
isAdmin: isAdmin,
|
isAdmin: isAdmin,
|
||||||
isRoot: isRoot,
|
isRoot: isRoot,
|
||||||
|
isVacation: user.isVacation,
|
||||||
injectFeaturedNote: profile?.injectFeaturedNote,
|
injectFeaturedNote: profile?.injectFeaturedNote,
|
||||||
receiveAnnouncementEmail: profile?.receiveAnnouncementEmail,
|
receiveAnnouncementEmail: profile?.receiveAnnouncementEmail,
|
||||||
alwaysMarkNsfw: profile?.alwaysMarkNsfw,
|
alwaysMarkNsfw: profile?.alwaysMarkNsfw,
|
||||||
|
|
|
@ -192,6 +192,12 @@ export class MiUser {
|
||||||
})
|
})
|
||||||
public isRoot: boolean;
|
public isRoot: boolean;
|
||||||
|
|
||||||
|
@Column('boolean', {
|
||||||
|
default: false,
|
||||||
|
comment: 'Whether the User is on vacation mode.',
|
||||||
|
})
|
||||||
|
public isVacation: boolean;
|
||||||
|
|
||||||
@Index()
|
@Index()
|
||||||
@Column('boolean', {
|
@Column('boolean', {
|
||||||
default: true,
|
default: true,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue