authsrv/src/db/migrations/1690040643986-init.js
2023-07-22 17:54:32 +02:00

28 lines
842 B
JavaScript

export class Init1690040643986 {
name = "Init1690040643986";
async up(queryRunner) {
await queryRunner.query(`
CREATE TABLE "account" (
"id" bigint NOT NULL,
"username" text NOT NULL,
"email" text NOT NULL,
"password" text NOT NULL,
CONSTRAINT "UQ_4c8f96ccf523e9a3faefd5bdd4c" UNIQUE ("email"),
CONSTRAINT "PK_54115ee388cdb6d86bb4bf5b2ea" PRIMARY KEY ("id")
)
`);
await queryRunner.query(`
CREATE UNIQUE INDEX "IDX_41dfcb70af895ddf9a53094515" ON "account" ("username")
`);
}
async down(queryRunner) {
await queryRunner.query(`
DROP INDEX "public"."IDX_41dfcb70af895ddf9a53094515"
`);
await queryRunner.query(`
DROP TABLE "account"
`);
}
}