3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-07 11:07:19 +00:00

fix: migrations with sql_require_primary_key=1

This commit is contained in:
Dragory 2024-04-06 11:49:45 +00:00
parent e11d2b48e4
commit 325341dced
No known key found for this signature in database
6 changed files with 47 additions and 14 deletions

View file

@ -10,11 +10,13 @@ export class CreateSlowmodeTables1544877081073 implements MigrationInterface {
name: "guild_id",
type: "bigint",
unsigned: true,
isPrimary: true,
},
{
name: "channel_id",
type: "bigint",
unsigned: true,
isPrimary: true,
},
{
name: "slowmode_seconds",
@ -25,7 +27,6 @@ export class CreateSlowmodeTables1544877081073 implements MigrationInterface {
indices: [],
}),
);
await queryRunner.createPrimaryKey("slowmode_channels", ["guild_id", "channel_id"]);
await queryRunner.createTable(
new Table({
@ -35,16 +36,19 @@ export class CreateSlowmodeTables1544877081073 implements MigrationInterface {
name: "guild_id",
type: "bigint",
unsigned: true,
isPrimary: true,
},
{
name: "channel_id",
type: "bigint",
unsigned: true,
isPrimary: true,
},
{
name: "user_id",
type: "bigint",
unsigned: true,
isPrimary: true,
},
{
name: "expires_at",
@ -58,7 +62,6 @@ export class CreateSlowmodeTables1544877081073 implements MigrationInterface {
],
}),
);
await queryRunner.createPrimaryKey("slowmode_users", ["guild_id", "channel_id", "user_id"]);
}
public async down(queryRunner: QueryRunner): Promise<any> {