This commit is contained in:
parent
43bbaa0035
commit
b800fbe741
2 changed files with 28 additions and 16 deletions
|
@ -3,18 +3,24 @@ import { MigrationInterface, QueryRunner, Table, TableColumn } from "typeorm";
|
|||
export class MoveStarboardsToConfig1573248462469 implements MigrationInterface {
|
||||
public async up(queryRunner: QueryRunner): Promise<any> {
|
||||
// Create a new column for the channel's id
|
||||
await queryRunner.addColumn("starboard_messages", new TableColumn({
|
||||
name: "starboard_channel_id",
|
||||
type: "bigint",
|
||||
unsigned: true,
|
||||
}));
|
||||
await queryRunner.addColumn(
|
||||
"starboard_messages",
|
||||
new TableColumn({
|
||||
name: "starboard_channel_id",
|
||||
type: "bigint",
|
||||
unsigned: true,
|
||||
}),
|
||||
);
|
||||
|
||||
// Since we are removing the guild_id with the starboards table, we might want it here
|
||||
await queryRunner.addColumn("starboard_messages", new TableColumn({
|
||||
name: "guild_id",
|
||||
type: "bigint",
|
||||
unsigned: true,
|
||||
}));
|
||||
await queryRunner.addColumn(
|
||||
"starboard_messages",
|
||||
new TableColumn({
|
||||
name: "guild_id",
|
||||
type: "bigint",
|
||||
unsigned: true,
|
||||
}),
|
||||
);
|
||||
|
||||
// Migrate the old starboard_id to the new starboard_channel_id
|
||||
await queryRunner.query(`
|
||||
|
@ -43,11 +49,14 @@ export class MoveStarboardsToConfig1573248462469 implements MigrationInterface {
|
|||
await queryRunner.dropColumn("starboard_messages", "starboard_channel_id");
|
||||
await queryRunner.dropColumn("starboard_messages", "guild_id");
|
||||
|
||||
await queryRunner.addColumn("starboard_messages", new TableColumn({
|
||||
name: "starboard_id",
|
||||
type: "int",
|
||||
unsigned: true,
|
||||
}));
|
||||
await queryRunner.addColumn(
|
||||
"starboard_messages",
|
||||
new TableColumn({
|
||||
name: "starboard_id",
|
||||
type: "int",
|
||||
unsigned: true,
|
||||
}),
|
||||
);
|
||||
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE starboard_messages
|
||||
|
|
|
@ -8,7 +8,10 @@
|
|||
/>
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
||||
<meta property="og:title" content="ZappyZep" />
|
||||
<meta property="og:description" content="ZappyZep is a private moderation bot for Discord, designed with large servers and reliability in mind." />
|
||||
<meta
|
||||
property="og:description"
|
||||
content="ZappyZep is a private moderation bot for Discord, designed with large servers and reliability in mind."
|
||||
/>
|
||||
<title>ZappyZep - Moderation bot for Discord</title>
|
||||
</head>
|
||||
<body>
|
||||
|
|
Loading…
Add table
Reference in a new issue