3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-18 07:35:02 +00:00

Start of move of reaction handling to DB

This commit is contained in:
Nils 2019-10-14 15:26:13 +02:00
parent 5a5fe4869e
commit f4cade3cb0
4 changed files with 125 additions and 6 deletions

View file

@ -0,0 +1,44 @@
import { MigrationInterface, QueryRunner, Table } from "typeorm";
export class CreateStarboardReactionsTable1571055675462 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<any> {
await queryRunner.createTable(
new Table({
name: "starboard_reactions",
columns: [
{
name: "id",
type: "int",
isGenerated: true,
generationStrategy: "increment",
isPrimary: true,
},
{
name: "guild_id",
type: "bigint",
unsigned: true,
},
{
name: "message_id",
type: "bigint",
unsigned: true,
},
{
name: "reactor_id",
type: "bigint",
unsigned: true,
},
],
indices: [
{
columnNames: ["reactor_id", "message_id"],
},
],
}),
);
}
public async down(queryRunner: QueryRunner): Promise<any> {
await queryRunner.dropTable("starboard_reactions", true, false, true);
}
}