Skip to content

Commit

Permalink
Merge pull request #762 from aura-nw/baseline/main_20230410
Browse files Browse the repository at this point in the history
Baseline code 20230410
  • Loading branch information
nhphuc2411 authored Apr 10, 2023
2 parents 2ac1f74 + f25b574 commit 34ed872
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ export class SmartContractRepository extends Repository<SmartContract> {
sc.token_symbol AS symbol,
sc.contract_address,
sc.num_tokens,
sc.total_tx,
IFNULL(tx_24h.no, 0) AS transfers_24h,
IFNULL(tx_3d.no, 0) AS transfers_3d,
uptime.timestamp AS upTime
Expand Down
19 changes: 19 additions & 0 deletions src/migrations/1680502133033-add-column-total-transaction.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

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

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE \`smart_contracts\` ADD \`total_tx\` int NOT NULL DEFAULT 0`,
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE \`smart_contracts\` DROP COLUMN \`total_tx\``,
);
}
}
3 changes: 3 additions & 0 deletions src/shared/entities/smart-contract.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,7 @@ export class SmartContract extends BaseEntityIncrementId {

@Column()
decimals: number;

@Column()
total_tx: number;
}

0 comments on commit 34ed872

Please sign in to comment.