From 84230447223541e1c4aa0579e487d0e81fa08c25 Mon Sep 17 00:00:00 2001 From: Redm4x <2829180+Redm4x@users.noreply.github.com> Date: Mon, 27 May 2024 22:20:34 -0500 Subject: [PATCH] fix(indexer): change predictedClosedHeight type to allow larger values --- indexer/UPGRADE.md | 10 ++++++++++ shared/dbSchemas/akash/lease.ts | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/indexer/UPGRADE.md b/indexer/UPGRADE.md index 283e79b6f..0bb6cb4be 100644 --- a/indexer/UPGRADE.md +++ b/indexer/UPGRADE.md @@ -4,6 +4,16 @@ Some indexer updates changes the database schemas and an upgrade script must be **It is recommended to stop the indexer before running any migration script.** +## v1.8.2 + +Change the type of the lease's `predictedClosedHeight` to allow larger values. +``` +ALTER TABLE lease +ALTER COLUMN "predictedClosedHeight" +TYPE numeric(30,0) +USING "predictedClosedHeight"::numeric(30,0); +``` + ## v1.8.0 Version 1.8.0 adds the necessary fields for improving the Akash provider uptime checks. diff --git a/shared/dbSchemas/akash/lease.ts b/shared/dbSchemas/akash/lease.ts index b5c06887d..445426cb2 100644 --- a/shared/dbSchemas/akash/lease.ts +++ b/shared/dbSchemas/akash/lease.ts @@ -26,7 +26,7 @@ export class Lease extends Model { @Required @Column providerAddress: string; @Required @Column createdHeight: number; @Column closedHeight?: number; - @Required @Column(DataTypes.BIGINT) predictedClosedHeight: number; + @Required @Column(DataTypes.DECIMAL(30, 0)) predictedClosedHeight: number; @Required @Column(DataTypes.DOUBLE) price: number; @Required @Default(0) @Column(DataTypes.DOUBLE) withdrawnAmount: number; @Required @Column denom: string;