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

staging to main #129

Merged
merged 123 commits into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
c2e9747
add required configs for funding pot execution to the env variables
ae2079 Oct 14, 2024
6511b96
refactor previous script to read the configs from common file and rep…
ae2079 Oct 14, 2024
c8c9022
add a script to create all the needed things to run the funding pot s…
ae2079 Oct 14, 2024
a3a662b
add execute:inverter:production command to the package.json file
ae2079 Oct 14, 2024
4960c86
remove funding pot env variables from mandatory variables
ae2079 Oct 14, 2024
f20e700
Upgraded axios dependencies
aminlatifi Oct 14, 2024
e1f70bf
change funding pot repo url to inverter repo
ae2079 Oct 15, 2024
2b52750
move helper functions to helper file
ae2079 Oct 15, 2024
a3898b5
generate batch configs automatic based on rounds data
ae2079 Oct 15, 2024
d5a52e0
use upper case and snake case from lodash
ae2079 Oct 15, 2024
1bcc6dd
fix bug
ae2079 Oct 15, 2024
9ee14aa
revert the changes related to use lodash
ae2079 Oct 15, 2024
af8aad1
Merge pull request #95 from GeneralMagicio/runFundingPotAutomatic
ae2079 Oct 15, 2024
c581f8c
Fix missing param in batch configs of funding pot service
ae2079 Oct 15, 2024
1cd612a
Fix bug in vesting time calculation
ae2079 Oct 16, 2024
ce9f212
adjust stream dates based on what tam said
ae2079 Oct 16, 2024
bb16eba
adjust changes on report by Fabi
ae2079 Oct 17, 2024
71b6c37
Merge branch 'staging' of github.com:GeneralMagicio/QAcc-BE into adju…
ae2079 Oct 17, 2024
8f15b04
add isBatchMintingExecuted field to the rounds tables
ae2079 Oct 17, 2024
54cf6ef
calculate batch number automatically and support only report flag
ae2079 Oct 17, 2024
a21e788
Merge pull request #99 from GeneralMagicio/adjustVestingDates
aminlatifi Oct 17, 2024
2dd1cb6
Updated cap calculation logic
aminlatifi Oct 18, 2024
d4871fd
Update cap records after donation is failed
aminlatifi Oct 18, 2024
1b925b0
Skipped isWalletAddressSmartContractTestCases
aminlatifi Oct 18, 2024
ab246dd
Merge pull request #101 from GeneralMagicio/feat/include-pending-dona…
aminlatifi Oct 18, 2024
98149fd
Update qacc capps after a pending donation is made
aminlatifi Oct 18, 2024
b8fef8d
Merge branch 'staging' into feat/include-pending-donation-in-cap
aminlatifi Oct 18, 2024
17645fc
Merge pull request #102 from GeneralMagicio/feat/include-pending-dona…
aminlatifi Oct 18, 2024
9a36a95
Fixed issues with donation resovler test
aminlatifi Oct 18, 2024
5bcc552
Fixed issue in update place
aminlatifi Oct 18, 2024
143bada
Merge pull request #103 from GeneralMagicio/feat/include-pending-dona…
ae2079 Oct 18, 2024
3044e66
handle NaN in reward amount calculation
ae2079 Oct 20, 2024
d35dd60
make env compatible with polygon zkEVM
ae2079 Oct 21, 2024
8bcd7b5
Remove test files
ae2079 Oct 21, 2024
113c95c
Remove sync reports from sync script
ae2079 Oct 21, 2024
a3f8cd2
Sync data with reports after batch minting execution
ae2079 Oct 21, 2024
8e43138
Add sync data with indexer cronjob
ae2079 Oct 21, 2024
480cf3c
Add funding pot execution to github actions
ae2079 Oct 22, 2024
4a98e55
Rename action
ae2079 Oct 22, 2024
7142a51
Merge pull request #104 from GeneralMagicio/SyncDataAfterBatchMinting
aminlatifi Oct 22, 2024
176a445
Merge pull request #105 from GeneralMagicio/AddFundingPotExecutionToG…
aminlatifi Oct 22, 2024
2ec5ad1
Added logs
aminlatifi Oct 22, 2024
14073e5
Prevent undefined issue
aminlatifi Oct 22, 2024
ea155c4
Upgraded node-cron
aminlatifi Oct 22, 2024
3f4f573
fix bug in calculating token price
ae2079 Oct 22, 2024
db85966
Merge pull request #106 from GeneralMagicio/FixBugInABCTokenPrice
aminlatifi Oct 22, 2024
5b0f6c1
Fixed issue in matching pending donation and updating project round r…
aminlatifi Oct 23, 2024
333c2db
Merge pull request #107 from GeneralMagicio/fix/match-pending-donation
aminlatifi Oct 23, 2024
19a58f6
Added more logs
aminlatifi Oct 23, 2024
79b700a
change round caps to be cumulative for ea rounds
ae2079 Oct 24, 2024
e735d3c
Merge pull request #108 from GeneralMagicio/fixIssueInRoundCapsForBat…
ae2079 Oct 24, 2024
f2158b9
Accept donations without round matching
aminlatifi Oct 24, 2024
0220700
Accept donations without round matching
aminlatifi Oct 24, 2024
9a4bcaf
Merge branch 'feat/refactor-donation-flow' of https://github.com/Gene…
aminlatifi Oct 24, 2024
d31fff8
Fixed linting issues
aminlatifi Oct 27, 2024
2e82a0c
Fixed failing tests
aminlatifi Oct 27, 2024
740b60c
Updated tests to support POL token on chain verification
aminlatifi Oct 27, 2024
eff5d79
Added test for matching with ea and qf round on verification
aminlatifi Oct 27, 2024
095d49a
use spawn instead of exec to show realtime logs
ae2079 Oct 27, 2024
d97e4ce
update stream times based on production values
ae2079 Oct 27, 2024
ffe23ef
add number of batch minting to the project table
ae2079 Oct 28, 2024
31ca0ff
add migration for adding number of batch minting to the project table
ae2079 Oct 28, 2024
44eb352
fill number of batch minting transaction numbers in the sync script
ae2079 Oct 28, 2024
33cd371
Merge branch 'staging' into feat/refactor-donation-flow
aminlatifi Oct 28, 2024
dc067a5
Merge pull request #109 from GeneralMagicio/feat/refactor-donation-flow
aminlatifi Oct 28, 2024
5ab9da7
Merge branch 'staging' into setCorrectStreamingDates
aminlatifi Oct 28, 2024
4036da5
Merge pull request #110 from GeneralMagicio/setCorrectStreamingDates
aminlatifi Oct 28, 2024
e6630f7
Merge pull request #111 from GeneralMagicio/SaveNumberOfBatchMintingT…
aminlatifi Oct 28, 2024
2abc123
Used donation time in validating the donations
aminlatifi Oct 28, 2024
b0cbd1d
Fixed issue in calling qac validator on draft donation resolver
aminlatifi Oct 28, 2024
9de38ce
Merge pull request #112 from GeneralMagicio/feat/import-missed-donations
aminlatifi Oct 28, 2024
93c9072
create output directory in funding pot production directory to save r…
ae2079 Oct 28, 2024
1bfe0e4
Accept donations don't match with rounds
aminlatifi Oct 29, 2024
aa1e4d4
Merge branch 'staging' into feat/import-missed-donations
aminlatifi Oct 29, 2024
3872ed3
Remove .only from atest
aminlatifi Oct 29, 2024
d0f7851
Merge branch 'feat/import-missed-donations' of https://github.com/Gen…
aminlatifi Oct 29, 2024
4d70d3a
Merge pull request #113 from GeneralMagicio/feat/import-missed-donations
aminlatifi Oct 29, 2024
b53d442
Added sync with ankr feature
aminlatifi Oct 29, 2024
9bf7460
Remove the api key
aminlatifi Oct 29, 2024
c965100
Merge branch 'staging' into feat/import-missed-donations
aminlatifi Oct 29, 2024
948b65e
Added ENABLE_ANKR_SYNC support
aminlatifi Oct 29, 2024
3f2a1ec
Merge branch 'feat/import-missed-donations' of https://github.com/Gen…
aminlatifi Oct 29, 2024
744a771
Changed donation source to CHAIN for those synced by ankr
aminlatifi Oct 29, 2024
011d251
Skip not needed test
aminlatifi Oct 29, 2024
258fb05
Merge pull request #114 from GeneralMagicio/feat/import-missed-donations
aminlatifi Oct 29, 2024
bdb0a83
Added ankr state migration
aminlatifi Oct 29, 2024
13b62ba
Fixed a fix
aminlatifi Oct 29, 2024
65dd43d
Fixed an issue
aminlatifi Oct 29, 2024
ee14989
Fixed issue in finding round in create donation
aminlatifi Oct 29, 2024
0b66cba
addes sorting field enums
lovelgeorge99 Oct 29, 2024
ee60ee9
Merge pull request #115 from GeneralMagicio/fix/create-donation-round…
ae2079 Oct 30, 2024
27e4537
Change numberOfBatchMintingTransactions column in project to batchNum…
ae2079 Oct 30, 2024
77c9dd5
add auto generated migration for the field changes
ae2079 Oct 30, 2024
d81e71c
fix type of graphql field
ae2079 Oct 30, 2024
5a7e3d7
Merge pull request #116 from GeneralMagicio/fix-sorting-donation
aminlatifi Oct 30, 2024
d85dc29
Merge pull request #118 from GeneralMagicio/addBatchNumbersWithTXsToP…
aminlatifi Oct 30, 2024
3b61a3c
Added flag for enabling jobs or graphql server
aminlatifi Oct 31, 2024
5de974f
Enabled graphql and job mode in test env
aminlatifi Oct 31, 2024
c2661ca
Updated staging docker-compose
aminlatifi Oct 31, 2024
89226f1
updated local run docker compose
aminlatifi Oct 31, 2024
4bd9ee7
Updated example env
aminlatifi Oct 31, 2024
41293c5
Merge pull request #119 from GeneralMagicio/feat/run-mode
aminlatifi Oct 31, 2024
6072ad8
FIxed log directory
aminlatifi Oct 31, 2024
b38f532
Merge branch 'staging' into feat/run-mode
aminlatifi Oct 31, 2024
3d7a356
Merge pull request #120 from GeneralMagicio/feat/run-mode
aminlatifi Oct 31, 2024
716556b
Added a log
aminlatifi Oct 31, 2024
72325c1
Added a try catch to have a save donation insert in importing from ch…
aminlatifi Oct 31, 2024
bffdcda
Added redis to test profile of test
aminlatifi Oct 31, 2024
79ef1bb
Fixed round matching issues
aminlatifi Oct 31, 2024
e7d08a3
Merge pull request #121 from GeneralMagicio/fix/round-matching
aminlatifi Oct 31, 2024
d7411d4
Removed extra check in donation validation
aminlatifi Oct 31, 2024
dff77cb
Merge branch 'staging' into fix/round-matching
aminlatifi Oct 31, 2024
49b6820
Fixed failed test
aminlatifi Oct 31, 2024
0e27d3a
Merge branch 'fix/round-matching' of https://github.com/GeneralMagici…
aminlatifi Oct 31, 2024
469715b
Merge pull request #122 from GeneralMagicio/fix/round-matching
aminlatifi Oct 31, 2024
fb5d1dc
Fixed issue in calculating project user record
aminlatifi Oct 31, 2024
25ff03e
Merge branch 'staging' into fix/round-matching
aminlatifi Oct 31, 2024
56dc9b5
Merge pull request #124 from GeneralMagicio/fix/round-matching
ae2079 Oct 31, 2024
eec60e2
Don't allow fetch round record befor it has started
aminlatifi Nov 1, 2024
fc03581
Merge pull request #125 from GeneralMagicio/fix/early-project-round-f…
aminlatifi Nov 1, 2024
4757fd0
Added unique index on donation transaction id
aminlatifi Nov 1, 2024
845c876
Merge pull request #128 from GeneralMagicio/feat/donation-transaction…
aminlatifi Nov 1, 2024
5ecbff6
Merge branch 'main' into staging
aminlatifi Nov 3, 2024
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
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
name: Run Inverter Sync Script
name: run-funding-pot-service

on:
schedule:
- cron: '0 0 * * 1' # Runs at midnight every Monday
# schedule:
# - cron: '0 0 * * 1' # Runs at midnight every Monday
workflow_dispatch: # This allows manual triggering

jobs:
run-script:
runs-on: ubuntu-latest

steps:
- name: SSH into Server and Run Inverter Sync Script
- name: SSH into Server and Run Funding Pot Service
uses: appleboy/[email protected]
env:
DELEGATE_PK_FOR_FUNDING_POT: ${{ secrets.DELEGATE_PK_FOR_FUNDING_POT }}
ANKR_API_KEY_FOR_FUNDING_POT: ${{ secrets.ANKR_API_KEY_FOR_FUNDING_POT }}
with:
host: ${{ secrets.STAGING_HOST }}
username: ${{ secrets.STAGING_USERNAME }}
key: ${{ secrets.STAGING_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd QAcc-BE
docker compose -f docker-compose-staging.yml exec qacc-be npm run sync:inverter:production
docker compose -f docker-compose-staging.yml exec qacc-be npm run execute:inverter:production
docker compose -f docker-compose-staging.yml logs qacc-be
16 changes: 14 additions & 2 deletions config/example.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
GRAPHQL_MODE=true
JOB_MODE=true

JWT_SECRET=
JWT_MAX_AGE=
TYPEORM_DATABASE_TYPE=
Expand Down Expand Up @@ -260,7 +263,7 @@ BASE_SEPOLIA_NODE_HTTP_URL=


ZKEVM_MAINNET_SCAN_API_URL=https://api-zkevm.polygonscan.com/api
ZKEVM_MAINET_SCAN_API_KEY=0000000000000000000000000000000000
ZKEVM_MAINNET_SCAN_API_KEY=0000000000000000000000000000000000
ZKEVM_CARDONA_SCAN_API_URL=https://api-cardona-zkevm.polygonscan.com/api
ZKEVM_CARDONA_SCAN_API_KEY=0000000000000000000000000000000000

Expand Down Expand Up @@ -288,4 +291,13 @@ PRIVADO_VERIFIER_NETWORK_ID=
PRIVADO_VERIFIER_CONTRACT_ADDRESS=
PRIVADO_REQUEST_ID=

INVERTER_GRAPHQL_ENDPOINT=
INVERTER_GRAPHQL_ENDPOINT=

# Funding pot service variables
DELEGATE_PK_FOR_FUNDING_POT=
ANKR_API_KEY_FOR_FUNDING_POT=

# Sync donations with ankr
ENABLE_ANKR_SYNC=
ANKR_RPC_URL=
ANKR_SYNC_CRONJOB_EXPRESSION=
13 changes: 11 additions & 2 deletions config/test.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
GRAPHQL_MODE=true
JOB_MODE=true

JWT_SECRET=00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
MAILER_JWT_SECRET=0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
JWT_MAX_AGE=7d
Expand Down Expand Up @@ -214,7 +217,7 @@ ZKEVM_MAINET_SCAN_API_KEY=0000000000000000000000000000000000
ZKEVM_CARDONA_SCAN_API_URL=https://api-cardona-zkevm.polygonscan.com/api
ZKEVM_CARDONA_SCAN_API_KEY=0000000000000000000000000000000000
# ZKEVM MAINNET we should fill it as Infura doesnt support polygon zkevm, I found this rpc link from https://chainlist.org/chain/1101
ZKEVM_MAINNET_NODE_HTTP_URL=https://polygon-zkevm.drpc.org
ZKEVM_MAINNET_NODE_HTTP_URL=https://zkevm-rpc.com

# ZKEVM CARDONA we should fill it as Infura doesnt support polygon zkevm, I found this rpc link from https://chainlist.org/chain/2442
ZKEVM_CARDONA_NODE_HTTP_URL=https://rpc.cardona.zkevm-rpc.com
Expand All @@ -230,4 +233,10 @@ PRIVADO_VERIFIER_NETWORK_ID=2442

INVERTER_GRAPHQL_ENDPOINT=https://indexer.bigdevenergy.link/a414bf3/v1/graphql

QACC_NETWORK_ID=11155420
QACC_NETWORK_ID=1101

QACC_DONATION_TOKEN_ADDRESS=0x22B21BedDef74FE62F031D2c5c8F7a9F8a4b304D
QACC_DONATION_TOKEN_DECIMALS=18
QACC_DONATION_TOKEN_NAME=Polygon Ecosystem Token
QACC_DONATION_TOKEN_SYMBOL=POL

24 changes: 22 additions & 2 deletions docker-compose-local.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
services:
qacc-be:
container_name: qacc-be
qacc-be-graph-ql:
container_name: qacc-be-graph-ql
build: .
profiles:
- server
command: npm run start:docker:locally
environment:
- ENVIRONMENT=local
- LOG_PATH=/usr/src/app/logs/qacc.log
- GRAPHQL_MODE=true
restart: always
volumes:
- ./config:/usr/src/app/config
Expand All @@ -18,6 +19,24 @@ services:
ports:
- '4001:4000'

qacc-be:
container_name: qacc-be-job
build: .
profiles:
- server
command: npm run start:docker:locally
environment:
- ENVIRONMENT=local
- LOG_PATH=/usr/src/app/logs/qacc.log
- JOB_MODE=true
restart: always
volumes:
- ./config:/usr/src/app/config
- ./config:/usr/src/app/build/config
- ./logs:/usr/src/app/logs
networks:
- qacc

qacc-postgres:
container_name: qacc-postgres
image: postgres:16
Expand Down Expand Up @@ -62,6 +81,7 @@ services:
image: redis:7-alpine
profiles:
- server
- test
- local
environment:
- REDIS_ALLOW_EMPTY_PASSWORD=yes
Expand Down
27 changes: 22 additions & 5 deletions docker-compose-production.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,37 @@
services:
qacc-be:
container_name: qacc-be
qacc-be-graph-ql:
container_name: qacc-be-graph-ql
image: ghcr.io/generalmagicio/qacc-be:main
command: npm run start:docker:server
environment:
- ENVIRONMENT=production
- LOG_PATH=/usr/src/app/logs/qacc.log
- GRAPHQL_MODE=true
restart: always
volumes:
- ./config:/usr/src/app/config
- ./config:/usr/src/app/build/config
- ./logs:/usr/src/app/logs
- ./logs-graph-ql:/usr/src/app/logs
networks:
- qacc
ports:
- "4001:4000"
- '4001:4000'

qacc-be-job:
container_name: qacc-be-job
image: ghcr.io/generalmagicio/qacc-be:main
command: npm run start:docker:server
environment:
- ENVIRONMENT=production
- LOG_PATH=/usr/src/app/logs/qacc.log
- JOB_MODE=true
restart: always
volumes:
- ./config:/usr/src/app/config
- ./config:/usr/src/app/build/config
- ./logs-job:/usr/src/app/logs
networks:
- qacc

qacc-redis:
container_name: qacc-redis
Expand All @@ -27,7 +44,7 @@ services:
networks:
- qacc
ports:
- "6379:6379"
- '6379:6379'

caddy:
image: caddy:2-alpine
Expand Down
29 changes: 23 additions & 6 deletions docker-compose-staging.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,37 @@
services:
qacc-be:
container_name: qacc-be
qacc-be-graph-ql:
container_name: qacc-be-graph-ql
image: ghcr.io/generalmagicio/qacc-be:staging
command: npm run start:docker:server
environment:
- ENVIRONMENT=production
- LOG_PATH=/usr/src/app/logs/qacc.log
- GRAPHQL_MODE=true
restart: always
volumes:
- ./config:/usr/src/app/config
- ./config:/usr/src/app/build/config
- ./logs:/usr/src/app/logs
- ./logs-graph-ql:/usr/src/app/logs
networks:
- qacc
ports:
- "4001:4000"
- '4001:4000'

qacc-be-job:
container_name: qacc-be-job
image: ghcr.io/generalmagicio/qacc-be:staging
command: npm run start:docker:server
environment:
- ENVIRONMENT=production
- LOG_PATH=/usr/src/app/logs/qacc.log
- JOB_MODE=true
restart: always
volumes:
- ./config:/usr/src/app/config
- ./config:/usr/src/app/build/config
- ./logs-job:/usr/src/app/logs
networks:
- qacc

qacc-redis:
container_name: qacc-redis
Expand All @@ -27,7 +44,7 @@ services:
networks:
- qacc
ports:
- "6379:6379"
- '6379:6379'

caddy:
image: caddy:2-alpine
Expand Down Expand Up @@ -56,4 +73,4 @@ volumes:
networks:
qacc:
name: qacc-be_qacc
external: true
external: true
Empty file added logs-graph-ql/.gitkeep
Empty file.
Empty file added logs-job/.gitkeep
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddIsBatchMintingExecutedFieldToRoundsTables1729133444025
implements MigrationInterface
{
name = 'AddIsBatchMintingExecutedFieldToRoundsTables1729133444025';

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "qf_round" ADD "isBatchMintingExecuted" boolean NOT NULL DEFAULT false`,
);
await queryRunner.query(
`ALTER TABLE "early_access_round" ADD "isBatchMintingExecuted" boolean NOT NULL DEFAULT false`,
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "early_access_round" DROP COLUMN "isBatchMintingExecuted"`,
);
await queryRunner.query(
`ALTER TABLE "qf_round" DROP COLUMN "isBatchMintingExecuted"`,
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddBatchMintingTransactionNumbersToProject1730076158010
implements MigrationInterface
{
name = 'AddBatchMintingTransactionNumbersToProject1730076158010';

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "project" ADD "numberOfBatchMintingTransactions" integer`,
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "project" DROP COLUMN "numberOfBatchMintingTransactions"`,
);
}
}
15 changes: 15 additions & 0 deletions migration/1730217125698-addAnkrState.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddAnkrState1730217125698 implements MigrationInterface {
name = 'AddAnkrState1730217125698';

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE TABLE "ankr_state" ("id" boolean NOT NULL, "timestamp" integer NOT NULL, CONSTRAINT "CHK_69b5646f9179ec91582413e97b" CHECK ("id"), CONSTRAINT "PK_3599fb1e1f37fa9a8da5b4113b7" PRIMARY KEY ("id"))`,
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP TABLE "ankr_state"`);
}
}
31 changes: 31 additions & 0 deletions migration/1730264518648-changeBatchNumberTXsFieldInPorjectTable.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class ChangeBatchNumberTXsFieldInPorjectTable1730264518648
implements MigrationInterface
{
name = 'ChangeBatchNumberTXsFieldInPorjectTable1730264518648';

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "project" RENAME COLUMN "numberOfBatchMintingTransactions" TO "batchNumbersWithSafeTransactions"`,
);
await queryRunner.query(
`ALTER TABLE "project" DROP COLUMN "batchNumbersWithSafeTransactions"`,
);
await queryRunner.query(
`ALTER TABLE "project" ADD "batchNumbersWithSafeTransactions" integer array NOT NULL DEFAULT '{}'`,
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "project" DROP COLUMN "batchNumbersWithSafeTransactions"`,
);
await queryRunner.query(
`ALTER TABLE "project" ADD "batchNumbersWithSafeTransactions" integer`,
);
await queryRunner.query(
`ALTER TABLE "project" RENAME COLUMN "batchNumbersWithSafeTransactions" TO "numberOfBatchMintingTransactions"`,
);
}
}
17 changes: 17 additions & 0 deletions migration/1730476526611-addDonationTransactionUniqIdx.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddDonationTransactionUniqIdx1730476526611
implements MigrationInterface
{
name = 'AddDonationTransactionUniqIdx1730476526611';

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE UNIQUE INDEX "unique_transaction_id" ON "donation" ("transactionId") `,
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP INDEX "public"."unique_transaction_id"`);
}
}
Loading
Loading