import { MigrationInterface, QueryRunner } from 'typeorm'; export class createUserTable1584708419706 implements MigrationInterface { name = 'createUserTable1584708419706'; public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "user" ("id" SERIAL NOT NULL, "email" character varying NOT NULL, "username" character varying NOT NULL, "role" character varying NOT NULL, "passwordHash" character varying NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, "version" integer NOT NULL, CONSTRAINT "UQ_e12875dfb3b1d92d7d7c5377e22" UNIQUE ("email"), CONSTRAINT "UQ_78a916df40e02a9deb1c4b75edb" UNIQUE ("username"), CONSTRAINT "PK_cace4a159ff9f2512dd42373760" PRIMARY KEY ("id"))`, undefined, ); } public async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`DROP TABLE "user"`, undefined); } }