Skip to content

Commit

Permalink
Patch version 0.1.1
Browse files Browse the repository at this point in the history
[Thanhhao1986][Main] Baseline code 20230317
  • Loading branch information
nhphuc2411 authored Mar 17, 2023
2 parents 4bbada0 + 7a050e1 commit 0dc6ffb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/migrations/1642148028305-Init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export class Init1642148028305 implements MigrationInterface {
await queryRunner.query(`CREATE TABLE \`blocks\` (\`created_at\` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), \`updated_at\` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`id\` int NOT NULL AUTO_INCREMENT, \`block_hash\` varchar(255) NOT NULL, \`chainid\` varchar(255) NOT NULL DEFAULT '', \`height\` int NOT NULL, \`identity\` varchar(255) NOT NULL DEFAULT '', \`moniker\` varchar(255) NOT NULL DEFAULT '', \`num_signatures\` int NOT NULL DEFAULT '0', \`num_txs\` int NOT NULL DEFAULT '0', \`operator_address\` varchar(255) NOT NULL DEFAULT '', \`proposer\` varchar(255) NOT NULL DEFAULT '', \`timestamp\` datetime NOT NULL, UNIQUE INDEX \`block_hash\` (\`block_hash\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
await queryRunner.query(`CREATE TABLE \`sync-status\` (\`created_at\` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), \`updated_at\` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`id\` int NOT NULL AUTO_INCREMENT, \`current_block\` int NOT NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
await queryRunner.query(`ALTER TABLE \`transactions\` ADD CONSTRAINT \`FK_e11180855c1afd8fe21f96a1bf8\` FOREIGN KEY (\`blockId\`) REFERENCES \`blocks\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
await queryRunner.query(`INSERT INTO \`sync-status\` (\`current_block\`) VALUES (0)`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
Expand Down

0 comments on commit 0dc6ffb

Please sign in to comment.