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

add migration to create the table

This commit is contained in:
Rstar284 2022-04-23 18:29:56 +04:00
parent 4dd538d952
commit 57adaf0b88
No known key found for this signature in database
GPG key ID: FB4E41B2606FAE1A
2 changed files with 44 additions and 1 deletions

View file

@ -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");
}
}

View file

@ -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;
},