Commit 2acbe34
committed
schema: Add migration
`0002_schema.up.sql` changes the PRIMARY KEY of `block`
table from `(height, hash)` to `height` only, in order
to prevent multiple rows from contending for the same height.
**NOTE** this operation is potentially destructive. If two
or more rows existed at the same height, they'll now be
missing from the database since we can't reliably determine
which block hash is the correct one.
Additionally, the anchor `block_hash` column previously
had the type INTEGER, and this was a mistake in the schema,
since block hashes are typically represented as a hex string.
Thus we change the type of the `block_hash` column to TEXT.0002_schema.up.sql
1 parent 4a393b5 commit 2acbe34
1 file changed
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
0 commit comments