Created
September 19, 2021 12:27
-
-
Save rskhan167/a2b1d170ee9eb630e6813526576a1ac2 to your computer and use it in GitHub Desktop.
Nestjs Series
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Migration } from '@mikro-orm/migrations'; | |
export class Migration20210808123050 extends Migration { | |
async up(): Promise<void> { | |
this.addSql( | |
'create table "user" ("id" serial primary key, "name" varchar(255) not null, "email" varchar(255) not null, "password" varchar(255) not null, "profile_image" varchar(255) null, "created_at" timestamptz(0) not null, "updated_at" timestamptz(0) not null);', | |
); | |
this.addSql( | |
'alter table "user" add constraint "user_email_unique" unique ("email");', | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment