parent
8a4f7fe0e8
commit
914efb6fcc
21 changed files with 95 additions and 41 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
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
import { TableForeignKey } from "typeorm";
|
||||
import { MigrationInterface, QueryRunner, TableForeignKey } from "typeorm";
|
||||
|
||||
export class AddCaseNotesForeignKey1596994103885 implements MigrationInterface {
|
||||
public async up(queryRunner: QueryRunner): Promise<any> {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
import { TableColumn } from "typeorm";
|
||||
import { MigrationInterface, QueryRunner, TableColumn } from "typeorm";
|
||||
|
||||
export class AddLogMessageIdToCases1597015567215 implements MigrationInterface {
|
||||
public async up(queryRunner: QueryRunner): Promise<any> {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
import { Table } from "typeorm";
|
||||
import { MigrationInterface, QueryRunner, Table } from "typeorm";
|
||||
|
||||
export class CreateMemberTimezonesTable1597109357201 implements MigrationInterface {
|
||||
public async up(queryRunner: QueryRunner): Promise<any> {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { MigrationInterface, QueryRunner, TableColumn, TableIndex } from "typeorm";
|
||||
import { TableForeignKey } from "typeorm";
|
||||
import { MigrationInterface, QueryRunner, TableColumn, TableForeignKey, TableIndex } from "typeorm";
|
||||
|
||||
export class UpdateCounterTriggers1617363975046 implements MigrationInterface {
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue