Initial Commit
This commit is contained in:
37
backend/api/migrations/1548630212872-MigrationTask.ts
Normal file
37
backend/api/migrations/1548630212872-MigrationTask.ts
Normal file
@ -0,0 +1,37 @@
|
||||
import { MigrationInterface, QueryRunner, Table } from 'typeorm';
|
||||
|
||||
export class MigrationTask1548630212872 implements MigrationInterface {
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<any> {
|
||||
await queryRunner.createTable(new Table({
|
||||
name: 'task',
|
||||
columns: [
|
||||
{
|
||||
name: 'id',
|
||||
type: 'int',
|
||||
isPrimary: true,
|
||||
}, {
|
||||
name: 'title',
|
||||
type: 'varchar',
|
||||
}, {
|
||||
name: 'done',
|
||||
type: 'boolean',
|
||||
}, {
|
||||
name: 'dueDate',
|
||||
type: 'datetime',
|
||||
}, {
|
||||
name: 'createdAt',
|
||||
type: 'datetime',
|
||||
}, {
|
||||
name: 'updatedAt',
|
||||
type: 'datetime',
|
||||
},
|
||||
],
|
||||
}), true);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<any> {
|
||||
console.log(queryRunner);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user