We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc032f0 commit de7f70bCopy full SHA for de7f70b
src/migrations/1611484925515-CreateUsersTable.ts
@@ -0,0 +1,20 @@
1
+import { MigrationInterface, QueryRunner } from 'typeorm';
2
+
3
+export class CreateUsersTable1611484925515 implements MigrationInterface {
4
+ public async up(queryRunner: QueryRunner): Promise<void> {
5
+ await queryRunner.query(
6
+ `CREATE TABLE users (
7
+ id int(11) NOT NULL AUTO_INCREMENT,
8
+ firstName varchar(255) NOT NULL,
9
+ lastName varchar(255) NOT NULL,
10
+ email varchar(255) NOT NULL,
11
+ password varchar(255) NOT NULL,
12
+ PRIMARY KEY (id)
13
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;`,
14
+ );
15
+ }
16
17
+ public async down(queryRunner: QueryRunner): Promise<void> {
18
+ await queryRunner.query(`DROP TABLE IF EXISTS users;`);
19
20
+}
0 commit comments