-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Undo Adding matchingFund to totalDonation amount of projects
related to #1186
- Loading branch information
Showing
25 changed files
with
470 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class AddSlugToQfRound1700998774661 implements MigrationInterface { | ||
async up(queryRunner: QueryRunner): Promise<void> { | ||
// Adding the 'slug' column with a default value | ||
await queryRunner.query( | ||
`ALTER TABLE qf_round ADD COLUMN slug TEXT NOT NULL DEFAULT ''`, | ||
); | ||
|
||
// Update the 'slug' column to use the 'id' for existing records | ||
await queryRunner.query(`UPDATE qf_round SET slug = id::text`); | ||
|
||
// Add a unique constraint to ensure slug uniqueness | ||
await queryRunner.query( | ||
`ALTER TABLE qf_round ADD CONSTRAINT qf_round_slug_unique UNIQUE (slug)`, | ||
); | ||
|
||
// Remove the default empty string now that all slugs have been set | ||
await queryRunner.query( | ||
`ALTER TABLE qf_round ALTER COLUMN slug DROP DEFAULT`, | ||
); | ||
} | ||
|
||
async down(queryRunner: QueryRunner): Promise<void> { | ||
// If you need to revert the migration, remove the unique constraint | ||
await queryRunner.query( | ||
`ALTER TABLE qf_round DROP CONSTRAINT qf_round_slug_unique`, | ||
); | ||
|
||
// Then drop the 'slug' column | ||
await queryRunner.query(`ALTER TABLE qf_round DROP COLUMN slug`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.