Skip to content

Commit

Permalink
fix: include batch index in db constraint for notes
Browse files Browse the repository at this point in the history
  • Loading branch information
mFragaBA committed Apr 5, 2024
1 parent bb79cb2 commit ea66a76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion store/src/db/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub static MIGRATIONS: Lazy<Migrations> = Lazy::new(|| {
tag INTEGER NOT NULL,
merkle_path BLOB NOT NULL,
PRIMARY KEY (block_num, note_index),
PRIMARY KEY (block_num, batch_index, note_index),
CONSTRAINT fk_block_num FOREIGN KEY (block_num) REFERENCES block_headers (block_num),
CONSTRAINT notes_block_number_is_u32 CHECK (block_num >= 0 AND block_num < 4294967296),
CONSTRAINT notes_batch_index_is_u32 CHECK (batch_index BETWEEN 0 AND 0xFFFFFFFF)
Expand Down

0 comments on commit ea66a76

Please sign in to comment.