Dashboard work. Move configs to DB. Some script reorganization. Add nodemon configs.
This commit is contained in:
parent
168d82a966
commit
2adc5af8d7
39 changed files with 8441 additions and 2915 deletions
51
src/migrations/1561111990357-CreateConfigsTable.ts
Normal file
51
src/migrations/1561111990357-CreateConfigsTable.ts
Normal file
|
@ -0,0 +1,51 @@
|
|||
import { MigrationInterface, QueryRunner, Table, TableIndex } from "typeorm";
|
||||
|
||||
export class CreateConfigsTable1561111990357 implements MigrationInterface {
|
||||
public async up(queryRunner: QueryRunner): Promise<any> {
|
||||
await queryRunner.createTable(
|
||||
new Table({
|
||||
name: "configs",
|
||||
columns: [
|
||||
{
|
||||
name: "id",
|
||||
type: "int",
|
||||
isPrimary: true,
|
||||
isGenerated: true,
|
||||
generationStrategy: "increment",
|
||||
},
|
||||
{
|
||||
name: "key",
|
||||
type: "varchar",
|
||||
length: "48",
|
||||
},
|
||||
{
|
||||
name: "config",
|
||||
type: "mediumtext",
|
||||
},
|
||||
{
|
||||
name: "is_active",
|
||||
type: "tinyint",
|
||||
},
|
||||
{
|
||||
name: "edited_by",
|
||||
type: "bigint",
|
||||
},
|
||||
{
|
||||
name: "edited_at",
|
||||
type: "datetime",
|
||||
default: "now()",
|
||||
},
|
||||
],
|
||||
indices: [
|
||||
{
|
||||
columnNames: ["key", "is_active"],
|
||||
},
|
||||
],
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<any> {
|
||||
await queryRunner.dropTable("configs", true);
|
||||
}
|
||||
}
|
39
src/migrations/1561117545258-CreateAllowedGuildsTable.ts
Normal file
39
src/migrations/1561117545258-CreateAllowedGuildsTable.ts
Normal file
|
@ -0,0 +1,39 @@
|
|||
import { MigrationInterface, QueryRunner, Table } from "typeorm";
|
||||
|
||||
export class CreateAllowedGuildsTable1561117545258 implements MigrationInterface {
|
||||
public async up(queryRunner: QueryRunner): Promise<any> {
|
||||
await queryRunner.createTable(
|
||||
new Table({
|
||||
name: "allowed_guilds",
|
||||
columns: [
|
||||
{
|
||||
name: "guild_id",
|
||||
type: "bigint",
|
||||
isPrimary: true,
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
type: "varchar",
|
||||
length: "255",
|
||||
},
|
||||
{
|
||||
name: "icon",
|
||||
type: "varchar",
|
||||
length: "255",
|
||||
collation: "ascii_general_ci",
|
||||
isNullable: true,
|
||||
},
|
||||
{
|
||||
name: "owner_id",
|
||||
type: "bigint",
|
||||
},
|
||||
],
|
||||
indices: [{ columnNames: ["owner_id"] }],
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<any> {
|
||||
await queryRunner.dropTable("allowed_guilds", true);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue