Skip to content

Commit

Permalink
Merge pull request #139 from GeneralMagicio/addEARoundsMigration
Browse files Browse the repository at this point in the history
Add rounds migration
  • Loading branch information
aminlatifi authored Nov 6, 2024
2 parents 1330948 + a23bd83 commit e98251d
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
20 changes: 20 additions & 0 deletions migration/1730852418249-InsertEARounds.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class InsertEARounds1730852418249 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
INSERT INTO "early_access_round" (
"roundNumber", "startDate", "endDate", "roundUSDCapPerProject", "roundUSDCapPerUserPerProject", "tokenPrice", "isBatchMintingExecuted"
) VALUES
(1, '2024-11-06 12:00:00', '2024-11-11 12:00:00', 100000, 5000, null, false),
(2, '2024-11-11 12:00:00', '2024-11-16 12:00:00', 200000, 10000, null, false),
(3, '2024-11-16 12:00:00', '2024-11-21 12:00:00', 200000, 10000, null, false)
`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
DELETE FROM "early_access_round" WHERE "roundNumber" IN (1, 2, 3)
`);
}
}
47 changes: 47 additions & 0 deletions migration/1730852760371-InsertQAccRound.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class InsertQAccRound1730852760371 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
INSERT INTO "qf_round" (
"roundNumber",
"name",
"title",
"description",
"slug",
"beginDate",
"endDate",
"tokenPrice",
"roundUSDCapPerProject",
"roundUSDCloseCapPerProject",
"roundUSDCapPerUserPerProject",
"isBatchMintingExecuted",
"isActive",
"allocatedFund",
"minimumPassportScore"
) VALUES (
1,
'QAcc first round',
'First QAcc round',
'This is the first QAcc round',
'round-1',
'2024-11-25 12:00:00',
'2024-12-09 12:00:00',
NULL,
1000000,
1050000,
2500,
false,
true,
1000000,
0
)
`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
DELETE FROM "qf_round" WHERE "roundNumber" = 1
`);
}
}

0 comments on commit e98251d

Please sign in to comment.