import { MigrationInterface , QueryRunner , Table } from 'typeorm' ; import { commonFields } from '../common.fields' ; const tableName = 'admin.permissions' ; export class createPermissionsTable1609619240082 implements MigrationInterface { public async up ( queryRunner ) { await queryRunner . createTable ( new Table ( { name : tableName , columns : [ { name : 'id' , type : 'integer' , isPrimary : true , isGenerated : true , isNullable : false , } , { name : 'slug' , type : 'varchar' , length : '160' , isNullable : false , isUnique : true , } , { name : 'description' , type : 'varchar' , length : '60' , isNullable : false , } , { name : 'active' , type : 'boolean' , isNullable : false , default : true , } , ... commonFields , ] , } ) , true ) ; } public async down ( queryRunner ) { await queryRunner . dropTable ( tableName , true ) ; } }