Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import {MigrationInterface, QueryRunner} from "typeorm";
  2.  
  3. export class CreateUserTable1563346816726 implements MigrationInterface {
  4.  
  5.     public async up(queryRunner: QueryRunner): Promise<any> {
  6.         await queryRunner.query(`CREATE TABLE "user" ("id" SERIAL NOT NULL, "email" character varying NOT NULL, "username" character varying NOT NULL, "displayName" character varying, CONSTRAINT "UQ_e12875dfb3b1d92d7d7c5377e22" UNIQUE ("email"), CONSTRAINT "UQ_78a916df40e02a9deb1c4b75edb" UNIQUE ("username"), CONSTRAINT "PK_cace4a159ff9f2512dd42373760" PRIMARY KEY ("id"))`);
  7.     }
  8.  
  9.     public async down(queryRunner: QueryRunner): Promise<any> {
  10.         await queryRunner.query(`DROP TABLE "user"`);
  11.     }
  12.  
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement