From 78d7d61315616ebbd1a98efd756f22dd3abee7fc Mon Sep 17 00:00:00 2001 From: Raman Shekhawat Date: Thu, 9 Nov 2023 03:20:50 +0530 Subject: [PATCH] add migration --- db/migrations/1699480194569-Data.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 db/migrations/1699480194569-Data.js diff --git a/db/migrations/1699480194569-Data.js b/db/migrations/1699480194569-Data.js new file mode 100644 index 000000000..12569a03f --- /dev/null +++ b/db/migrations/1699480194569-Data.js @@ -0,0 +1,15 @@ +module.exports = class Data1699480194569 { + name = 'Data1699480194569' + + async up(db) { + await db.query(`CREATE TABLE "multi_tokens_claims" ("id" character varying NOT NULL, "eth_account" text NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL, "account_id" character varying, CONSTRAINT "PK_f074c8e8d71ea5023df43762615" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_c8aaf94cba10437b7503292814" ON "multi_tokens_claims" ("account_id") `) + await db.query(`ALTER TABLE "multi_tokens_claims" ADD CONSTRAINT "FK_c8aaf94cba10437b75032928149" FOREIGN KEY ("account_id") REFERENCES "account"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + } + + async down(db) { + await db.query(`DROP TABLE "multi_tokens_claims"`) + await db.query(`DROP INDEX "public"."IDX_c8aaf94cba10437b7503292814"`) + await db.query(`ALTER TABLE "multi_tokens_claims" DROP CONSTRAINT "FK_c8aaf94cba10437b75032928149"`) + } +}