Add data model changes
This commit is contained in:
parent
7a5d7f46b6
commit
ca29f047e9
19
src/data/migrations/1669392941776-data.ts
Normal file
19
src/data/migrations/1669392941776-data.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||||
|
|
||||||
|
export class data1669392941776 implements MigrationInterface {
|
||||||
|
name = 'data1669392941776'
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`
|
||||||
|
ALTER TABLE "guild_setting"
|
||||||
|
ADD "preserveDataOnGuildLeave" boolean NOT NULL DEFAULT false
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`
|
||||||
|
ALTER TABLE "guild_setting" DROP COLUMN "preserveDataOnGuildLeave"
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -10,4 +10,7 @@ export class GuildSetting {
|
|||||||
|
|
||||||
@Column("timestamp", { nullable: true, default: null })
|
@Column("timestamp", { nullable: true, default: null })
|
||||||
isPremiumUntil!: Date | null;
|
isPremiumUntil!: Date | null;
|
||||||
|
|
||||||
|
@Column("boolean", { default: false })
|
||||||
|
preserveDataOnGuildLeave!: boolean
|
||||||
}
|
}
|
@ -12,6 +12,7 @@ export async function getGuildSetting(guildID: string): Promise<GuildSetting> {
|
|||||||
guildSetting.id = guildID;
|
guildSetting.id = guildID;
|
||||||
guildSetting.isPremiumUntil = null;
|
guildSetting.isPremiumUntil = null;
|
||||||
guildSetting.notificationChannelID = null;
|
guildSetting.notificationChannelID = null;
|
||||||
|
guildSetting.preserveDataOnGuildLeave = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return guildSetting;
|
return guildSetting;
|
||||||
|
Loading…
Reference in New Issue
Block a user