Skip to content

Commit

Permalink
fix linter down method in migration
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosQ96 committed Sep 23, 2023
1 parent 4070b19 commit 775d3cd
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions migrations/1695508418383-RemoveSafeTransactionHash.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm';

export class RemoveSafeTransactionHash1695508418383
implements MigrationInterface
Expand All @@ -15,5 +15,22 @@ export class RemoveSafeTransactionHash1695508418383
}
}

public async down(queryRunner: QueryRunner): Promise<void> {}
public async down(queryRunner: QueryRunner): Promise<void> {
const table = await queryRunner.getTable('multisig_session');
if (!table) return;

const safeTransactionHashColumnExists = table.columns.some(
c => c.name === 'safeTransactionHash',
);
if (!safeTransactionHashColumnExists) {
await queryRunner.addColumn(
'multisig_session',
new TableColumn({
name: 'safeTransactionHash',
type: 'varchar',
isNullable: true,
}),
);
}
}
}

0 comments on commit 775d3cd

Please sign in to comment.