Skip to content

Commit

Permalink
add migration
Browse files Browse the repository at this point in the history
  • Loading branch information
justraman committed Nov 8, 2023
1 parent 5716527 commit 78d7d61
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions db/migrations/1699480194569-Data.js
Original file line number Diff line number Diff line change
@@ -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"`)
}
}

0 comments on commit 78d7d61

Please sign in to comment.