mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 22:21:51 +00:00
Fix 3
This commit is contained in:
parent
5489840bb4
commit
0687e67bc5
1 changed files with 8 additions and 1 deletions
|
@ -2,7 +2,14 @@ import { MigrationInterface, QueryRunner, TableColumn, TableIndex } from "typeor
|
||||||
|
|
||||||
export class AddTypeAndPermissionsToApiPermissions1573158035867 implements MigrationInterface {
|
export class AddTypeAndPermissionsToApiPermissions1573158035867 implements MigrationInterface {
|
||||||
public async up(queryRunner: QueryRunner): Promise<any> {
|
public async up(queryRunner: QueryRunner): Promise<any> {
|
||||||
await queryRunner.dropIndex("api_permissions", new TableIndex({ columnNames: ["user_id"] }));
|
try {
|
||||||
|
await queryRunner.dropPrimaryKey("api_permissions");
|
||||||
|
} catch (e) {} // tslint:disable-line
|
||||||
|
|
||||||
|
const table = await queryRunner.getTable("api_permissions");
|
||||||
|
if (table.indices.length) {
|
||||||
|
await queryRunner.dropIndex("api_permissions", table.indices[0]);
|
||||||
|
}
|
||||||
|
|
||||||
await queryRunner.addColumn(
|
await queryRunner.addColumn(
|
||||||
"api_permissions",
|
"api_permissions",
|
||||||
|
|
Loading…
Add table
Reference in a new issue