mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-27 11:15:02 +00:00
Reorganize project. Add folder for shared code between backend/dashboard. Switch from jest to ava for tests.
This commit is contained in:
parent
80a82fe348
commit
16111bbe84
162 changed files with 11056 additions and 9900 deletions
70
backend/src/migrations/1544877081073-CreateSlowmodeTables.ts
Normal file
70
backend/src/migrations/1544877081073-CreateSlowmodeTables.ts
Normal file
|
@ -0,0 +1,70 @@
|
|||
import { MigrationInterface, QueryRunner, Table } from "typeorm";
|
||||
|
||||
export class CreateSlowmodeTables1544877081073 implements MigrationInterface {
|
||||
public async up(queryRunner: QueryRunner): Promise<any> {
|
||||
await queryRunner.createTable(
|
||||
new Table({
|
||||
name: "slowmode_channels",
|
||||
columns: [
|
||||
{
|
||||
name: "guild_id",
|
||||
type: "bigint",
|
||||
unsigned: true,
|
||||
},
|
||||
{
|
||||
name: "channel_id",
|
||||
type: "bigint",
|
||||
unsigned: true,
|
||||
},
|
||||
{
|
||||
name: "slowmode_seconds",
|
||||
type: "int",
|
||||
unsigned: true,
|
||||
},
|
||||
],
|
||||
indices: [],
|
||||
}),
|
||||
);
|
||||
await queryRunner.createPrimaryKey("slowmode_channels", ["guild_id", "channel_id"]);
|
||||
|
||||
await queryRunner.createTable(
|
||||
new Table({
|
||||
name: "slowmode_users",
|
||||
columns: [
|
||||
{
|
||||
name: "guild_id",
|
||||
type: "bigint",
|
||||
unsigned: true,
|
||||
},
|
||||
{
|
||||
name: "channel_id",
|
||||
type: "bigint",
|
||||
unsigned: true,
|
||||
},
|
||||
{
|
||||
name: "user_id",
|
||||
type: "bigint",
|
||||
unsigned: true,
|
||||
},
|
||||
{
|
||||
name: "expires_at",
|
||||
type: "datetime",
|
||||
},
|
||||
],
|
||||
indices: [
|
||||
{
|
||||
columnNames: ["expires_at"],
|
||||
},
|
||||
],
|
||||
}),
|
||||
);
|
||||
await queryRunner.createPrimaryKey("slowmode_users", ["guild_id", "channel_id", "user_id"]);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<any> {
|
||||
await Promise.all([
|
||||
queryRunner.dropTable("slowmode_channels", true),
|
||||
queryRunner.dropTable("slowmode_users", true),
|
||||
]);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue