From ca33679e4965dbe3045a2823d6663c87f85fb675 Mon Sep 17 00:00:00 2001 From: Christopher Tarry Date: Fri, 5 Jan 2024 14:29:18 -0500 Subject: [PATCH] sql changes --- persist/sqlite/init.sql | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/persist/sqlite/init.sql b/persist/sqlite/init.sql index c78eb8d7..0aa6c968 100644 --- a/persist/sqlite/init.sql +++ b/persist/sqlite/init.sql @@ -4,18 +4,19 @@ CREATE TABLE global_settings ( ); CREATE TABLE blocks ( - id BINARY(32) NOT NULL PRIMARY KEY, + id BLOB NOT NULL PRIMARY KEY, height INTEGER NOT NULL, - parent_id BINARY(32) NOT NULL, - nonce BINARY(8) NOT NULL, + parent_id BLOB NOT NULL, + nonce BLOB NOT NULL, timestamp INTEGER NOT NULL ); CREATE TABLE miner_payouts ( - block_id REFERENCES blocks(id) ON DELETE CASCADE, + block_id BLOB REFERENCES blocks(id) ON DELETE CASCADE NOT NULL PRIMARY KEY, block_order INTEGER NOT NULL, - address BINARY(32) NOT NULL, - value BINARY(16) NOT NULL + address BLOB NOT NULL, + value BLOB NOT NULL, + UNIQUE(block_id, block_order) );