mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-25 18:25:03 +00:00
add migration to create the table
This commit is contained in:
parent
4dd538d952
commit
57adaf0b88
2 changed files with 44 additions and 1 deletions
|
@ -0,0 +1,43 @@
|
|||
import { MigrationInterface, QueryRunner, Table } from "typeorm";
|
||||
|
||||
export class CreateTagAliasesTable1650721595278 implements MigrationInterface {
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.createTable(
|
||||
new Table({
|
||||
name: "tag_aliases",
|
||||
columns: [
|
||||
{
|
||||
name: "guild_id",
|
||||
type: "bigint",
|
||||
isPrimary: true,
|
||||
},
|
||||
{
|
||||
name: "alias",
|
||||
type: "varchar",
|
||||
length: "255",
|
||||
isPrimary: true,
|
||||
},
|
||||
{
|
||||
name: "tag",
|
||||
type: "varchar",
|
||||
length: "255",
|
||||
isPrimary: true,
|
||||
},
|
||||
{
|
||||
name: "user_id",
|
||||
type: "bigint",
|
||||
},
|
||||
{
|
||||
name: "created_at",
|
||||
type: "datetime",
|
||||
default: "now()",
|
||||
},
|
||||
],
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
queryRunner.dropTable("tag_aliases");
|
||||
}
|
||||
}
|
|
@ -21,7 +21,7 @@ export const TagListAliasesCmd = tagsCmd({
|
|||
aliasesArr = aliases.map((a) => a.alias);
|
||||
createChunkedMessage(
|
||||
msg.channel,
|
||||
`Available aliases for tag \`${prefix + args.tag}\`: \`\`\`${aliasesArr.join(", ")}\`\`\``,
|
||||
`Available aliases for tag \`${args.tag}\` (use with \`${prefix}alias\`: \`\`\`${aliasesArr.join(", ")}\`\`\``,
|
||||
);
|
||||
return;
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue