Skip to content

Commit

Permalink
Merge pull request #691 from Giveth/hotfix_1661_delete_gnosis_recipie…
Browse files Browse the repository at this point in the history
…nts_of_givingblocks_projects

Hotfix 1661 delete gnosis recipients of givingblocks projects
  • Loading branch information
mohammadranjbarz authored Oct 18, 2022
2 parents e1f1730 + 4958fe5 commit 5123d77
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class deleteGnosisRecipientsOfGivingblocksProjects1666068280230
implements MigrationInterface
{
async up(queryRunner: QueryRunner): Promise<void> {
const projectTableExists = await queryRunner.hasTable('project');
const projectAddressTableExists = await queryRunner.hasTable(
'project_address',
);
if (!projectTableExists || !projectAddressTableExists) {
// tslint:disable-next-line:no-console
console.log('The project table or project_Address table doesnt exist', {
projectAddressTableExists,
projectTableExists,
});
return;
}

await queryRunner.query(`
DELETE FROM project_address
USING project
WHERE project_address."projectId" = project.id AND project_address."networkId"=100 AND project."givingBlocksId" IS NOT NULL
`);
}

async down(queryRunner: QueryRunner): Promise<void> {}
}

0 comments on commit 5123d77

Please sign in to comment.