Skip to content

Instantly share code, notes, and snippets.

@rskhan167
Created September 19, 2021 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rskhan167/a2b1d170ee9eb630e6813526576a1ac2 to your computer and use it in GitHub Desktop.
Save rskhan167/a2b1d170ee9eb630e6813526576a1ac2 to your computer and use it in GitHub Desktop.
Nestjs Series
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