diff --git a/backend-rust/src/migrations/m0002-block-cumulative-fin-time-index.sql b/backend-rust/src/migrations/m0002-block-cumulative-fin-time-index.sql index 2f9bc9ea..0d0fe686 100644 --- a/backend-rust/src/migrations/m0002-block-cumulative-fin-time-index.sql +++ b/backend-rust/src/migrations/m0002-block-cumulative-fin-time-index.sql @@ -3,6 +3,8 @@ CREATE INDEX blocks_height_null_cumulative_finalization_time ON blocks (height) WHERE blocks.cumulative_finalization_time IS NULL AND blocks.finalization_time IS NOT NULL; +-- blocks_hash_gin_trgm_idx index does not suppport char +ALTER TABLE blocks ALTER COLUMN hash SET DATA TYPE VARCHAR(64); -- Used to efficiently perform partial string matching on the `hash` column, -- allowing fast lookups when searching for blocks by their hash prefix using `LIKE`. CREATE INDEX blocks_hash_gin_trgm_idx ON blocks USING gin(hash gin_trgm_ops);