From 4c90848edaa31b435b10508983adfc51945d9780 Mon Sep 17 00:00:00 2001 From: Rstar284 Date: Sat, 23 Apr 2022 18:29:56 +0400 Subject: [PATCH] add migration to create the table --- .../1650721595278-CreateTagAliasesTable.ts | 43 +++++++++++++++++++ .../Tags/commands/TagListAliasesCmd.ts | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 backend/src/migrations/1650721595278-CreateTagAliasesTable.ts diff --git a/backend/src/migrations/1650721595278-CreateTagAliasesTable.ts b/backend/src/migrations/1650721595278-CreateTagAliasesTable.ts new file mode 100644 index 00000000..4b69efc8 --- /dev/null +++ b/backend/src/migrations/1650721595278-CreateTagAliasesTable.ts @@ -0,0 +1,43 @@ +import { MigrationInterface, QueryRunner, Table } from "typeorm"; + +export class CreateTagAliasesTable1650721595278 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + 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 { + queryRunner.dropTable("tag_aliases"); + } +} diff --git a/backend/src/plugins/Tags/commands/TagListAliasesCmd.ts b/backend/src/plugins/Tags/commands/TagListAliasesCmd.ts index 4d5482bc..b53a58fd 100644 --- a/backend/src/plugins/Tags/commands/TagListAliasesCmd.ts +++ b/backend/src/plugins/Tags/commands/TagListAliasesCmd.ts @@ -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; },