2019-01-12 14:09:11 +02:00
|
|
|
import { MigrationInterface, QueryRunner, Table } from "typeorm";
|
|
|
|
|
|
|
|
export class CreatePingableRolesTable1547293464842 implements MigrationInterface {
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<any> {
|
|
|
|
await queryRunner.createTable(
|
|
|
|
new Table({
|
|
|
|
name: "pingable_roles",
|
|
|
|
columns: [
|
|
|
|
{
|
|
|
|
name: "id",
|
|
|
|
type: "int",
|
|
|
|
unsigned: true,
|
|
|
|
isGenerated: true,
|
|
|
|
generationStrategy: "increment",
|
2019-11-02 22:11:26 +02:00
|
|
|
isPrimary: true,
|
2019-01-12 14:09:11 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "guild_id",
|
|
|
|
type: "bigint",
|
2019-11-02 22:11:26 +02:00
|
|
|
unsigned: true,
|
2019-01-12 14:09:11 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "channel_id",
|
|
|
|
type: "bigint",
|
2019-11-02 22:11:26 +02:00
|
|
|
unsigned: true,
|
2019-01-12 14:09:11 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "role_id",
|
|
|
|
type: "bigint",
|
2019-11-02 22:11:26 +02:00
|
|
|
unsigned: true,
|
|
|
|
},
|
2019-01-12 14:09:11 +02:00
|
|
|
],
|
|
|
|
indices: [
|
|
|
|
{
|
2019-11-02 22:11:26 +02:00
|
|
|
columnNames: ["guild_id", "channel_id"],
|
2019-01-12 14:09:11 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
columnNames: ["guild_id", "channel_id", "role_id"],
|
2019-11-02 22:11:26 +02:00
|
|
|
isUnique: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}),
|
2019-01-12 14:09:11 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<any> {
|
|
|
|
await queryRunner.dropTable("pingable_roles", true);
|
|
|
|
}
|
|
|
|
}
|