Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

Commit 44a2be6

Browse files
committed
fix: select correct block hash upon migration
1 parent a69f438 commit 44a2be6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

migrations/1718498685557_inscriptions-block-hash.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ export function up(pgm: MigrationBuilder): void {
1111
});
1212
pgm.sql(`
1313
UPDATE inscriptions SET block_hash = (
14-
SELECT block_hash FROM locations AS l WHERE l.ordinal_number = ordinal_number LIMIT 1
15-
)
14+
SELECT block_hash FROM locations AS l
15+
WHERE l.ordinal_number = ordinal_number
16+
AND l.block_height = block_height
17+
AND l.tx_index = tx_index
18+
LIMIT 1
19+
)
1620
`);
1721
pgm.alterColumn('inscriptions', 'block_hash', { notNull: true });
1822
}

0 commit comments

Comments
 (0)