Release/1.0.0 beta.3 #10
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 })
|
||||
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.isPremiumUntil = null;
|
||||
guildSetting.notificationChannelID = null;
|
||||
guildSetting.preserveDataOnGuildLeave = false;
|
||||
}
|
||||
|
||||
return guildSetting;
|
||||
|
Loading…
Reference in New Issue
Block a user