Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master to stage from master #1697

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 16 additions & 26 deletions migration/1719887968639-addUseDonationBoxToDraftDonations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,24 @@ export class AddUseDonationBoxToDraftDonations1719887968639
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
const table = await queryRunner.getTable('draft_donation');
const useDonationBoxColumn = table?.findColumnByName('useDonationBox');
const relevantDonationTxHashColumn = table?.findColumnByName(
'relevantDonationTxHash',
await queryRunner.addColumn(
'draft_donation',
new TableColumn({
name: 'useDonationBox',
type: 'boolean',
isNullable: true,
default: false,
}),
);

if (!useDonationBoxColumn) {
await queryRunner.addColumn(
'draft_donation',
new TableColumn({
name: 'useDonationBox',
type: 'boolean',
isNullable: true,
default: false,
}),
);
}

if (!relevantDonationTxHashColumn) {
await queryRunner.addColumn(
'draft_donation',
new TableColumn({
name: 'relevantDonationTxHash',
type: 'varchar',
isNullable: true,
}),
);
}
await queryRunner.addColumn(
'draft_donation',
new TableColumn({
name: 'relevantDonationTxHash',
type: 'varchar',
isNullable: true,
}),
);
}

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