Skip to content

Commit

Permalink
fix migration file for approvalExpirationDate
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosQ96 committed Oct 4, 2023
1 parent e3e2ffa commit 3e40699
Showing 1 changed file with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@ export class AddExpirationDateResetToMultisigSession1696397559095
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.addColumn(
'multisig_session',
new TableColumn({
name: 'approvalExpirationDate',
type: 'date',
isNullable: true,
}),
const table = await queryRunner.getTable('multisig_session');
if (!table) return;

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

public async down(queryRunner: QueryRunner): Promise<void> {
Expand Down

0 comments on commit 3e40699

Please sign in to comment.