Skip to content

Commit

Permalink
fix: make tx receipt root field nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
vasyl-ivanchuk committed Nov 5, 2024
1 parent 25606ec commit b77d3dc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/worker/src/entities/transactionReceipt.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ export class TransactionReceipt extends CountableEntity {
@Column({ type: "int" })
public readonly type: number;

@Column({ type: "bytea", transformer: hexTransformer })
public readonly root: string;
@Column({ type: "bytea", transformer: hexTransformer, nullable: true })
public readonly root?: string;

@Column({ type: "varchar", length: 128 })
public readonly gasUsed: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { MigrationInterface, QueryRunner } from "typeorm";

export class TxReceiptRootColumnNullable1730806000905 implements MigrationInterface {
name = "TxReceiptRootColumnNullable1730806000905";

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "transactionReceipts" ALTER COLUMN "root" DROP NOT NULL`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "transactionReceipts" ALTER COLUMN "root" SET NOT NULL`);
}
}

0 comments on commit b77d3dc

Please sign in to comment.