From fa2447e71baca01165d7a4cc7b9b740563ca27fd Mon Sep 17 00:00:00 2001 From: mattyatea Date: Tue, 24 Oct 2023 20:46:08 +0900 Subject: [PATCH] migration file Signed-off-by: mattyatea --- .../backend/migration/1698131657286-EmojiRequest.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 packages/backend/migration/1698131657286-EmojiRequest.js diff --git a/packages/backend/migration/1698131657286-EmojiRequest.js b/packages/backend/migration/1698131657286-EmojiRequest.js new file mode 100644 index 0000000000..7db57c9cd0 --- /dev/null +++ b/packages/backend/migration/1698131657286-EmojiRequest.js @@ -0,0 +1,13 @@ +export class EmojiRequest1698131657286 { + name = 'EmojiRequest1698131657286' + + async up(queryRunner) { + await queryRunner.query(`CREATE TABLE "emoji_request" ("id" character varying(32) NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE, "name" character varying(128) NOT NULL, "category" character varying(128), "originalUrl" character varying(512) NOT NULL, "publicUrl" character varying(512) NOT NULL DEFAULT '', "type" character varying(64), "aliases" character varying(128) array NOT NULL DEFAULT '{}', "license" character varying(1024), "fileId" character varying(1024) NOT NULL, "localOnly" boolean NOT NULL DEFAULT false, "isSensitive" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_3c74521e048dc744f0c7eb65f4a" PRIMARY KEY ("id"))`); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_ea1d771e867e9843300f09d02c" ON "emoji_request" ("name") `); + } + + async down(queryRunner) { + await queryRunner.query(`DROP INDEX "public"."IDX_ea1d771e867e9843300f09d02c"`); + await queryRunner.query(`DROP TABLE "emoji_request"`); + } +}