33-- information, along with indexing information is stored.
44-- TODO(roasbeef): also store SPV proof?
55CREATE TABLE IF NOT EXISTS chain_txns (
6- txn_id BIGINT PRIMARY KEY ,
6+ txn_id INTEGER PRIMARY KEY ,
77
88 txid BLOB UNIQUE NOT NULL ,
99
@@ -23,7 +23,7 @@ CREATE TABLE IF NOT EXISTS chain_txns (
2323-- outpoint itself, and also a references to the transaction that _spends_ that
2424-- outpoint.
2525CREATE TABLE IF NOT EXISTS genesis_points (
26- genesis_id BIGINT PRIMARY KEY ,
26+ genesis_id INTEGER PRIMARY KEY ,
2727
2828 -- TODO(roasbeef): just need the input index here instead?
2929 prev_out BLOB UNIQUE NOT NULL ,
@@ -35,7 +35,7 @@ CREATE TABLE IF NOT EXISTS genesis_points (
3535-- assets that we either created, or bootstrapped from the relevant Base
3636-- Universe.
3737CREATE TABLE IF NOT EXISTS assets_meta (
38- meta_id BIGINT PRIMARY KEY ,
38+ meta_id INTEGER PRIMARY KEY ,
3939
4040 meta_data_hash BLOB UNIQUE CHECK (length(meta_data_hash) = 32 ),
4141
@@ -50,7 +50,7 @@ CREATE TABLE IF NOT EXISTS assets_meta (
5050-- reference the genesis point which is also a necessary component for
5151-- computing an asset ID.
5252CREATE TABLE IF NOT EXISTS genesis_assets (
53- gen_asset_id BIGINT PRIMARY KEY ,
53+ gen_asset_id INTEGER PRIMARY KEY ,
5454
5555 asset_id BLOB UNIQUE,
5656
@@ -72,7 +72,7 @@ CREATE INDEX IF NOT EXISTS asset_ids on genesis_assets(asset_id);
7272-- full KeyLocator is stored so we can use these keys without actually storing
7373-- the private keys on disk.
7474CREATE TABLE IF NOT EXISTS internal_keys (
75- key_id BIGINT PRIMARY KEY ,
75+ key_id INTEGER PRIMARY KEY ,
7676
7777 -- We'll always store the full 33-byte key on disk, to make sure we're
7878 -- retaining full information.
@@ -88,7 +88,7 @@ CREATE TABLE IF NOT EXISTS internal_keys (
8888-- tweaking the base group key by the associated genesis point. This table
8989-- references the set of internal keys, and also the genesis_points table.
9090CREATE TABLE IF NOT EXISTS asset_groups (
91- group_id BIGINT PRIMARY KEY ,
91+ group_id INTEGER PRIMARY KEY ,
9292
9393 tweaked_group_key BLOB UNIQUE NOT NULL CHECK (length(tweaked_group_key) = 33 ),
9494
@@ -107,7 +107,7 @@ CREATE TABLE IF NOT EXISTS asset_groups (
107107-- asset ID must also be included. This table reference the asset ID it's used
108108-- to create as well as the group key that signed the asset in the first place.
109109CREATE TABLE IF NOT EXISTS asset_group_witnesses (
110- witness_id BIGINT PRIMARY KEY ,
110+ witness_id INTEGER PRIMARY KEY ,
111111
112112 -- The witness stack can contain either a single Schnorr signature for key
113113 -- spends of the tweaked group key, or a more complex script witness.
@@ -124,7 +124,7 @@ CREATE TABLE IF NOT EXISTS asset_group_witnesses (
124124-- wallet, so the wallet is able to keep track of the amount of sats that are
125125-- used to anchor Taproot assets.
126126CREATE TABLE IF NOT EXISTS managed_utxos (
127- utxo_id BIGINT PRIMARY KEY ,
127+ utxo_id INTEGER PRIMARY KEY ,
128128
129129 outpoint BLOB UNIQUE NOT NULL ,
130130
@@ -163,7 +163,7 @@ CREATE TABLE IF NOT EXISTS managed_utxos (
163163);
164164
165165CREATE TABLE IF NOT EXISTS script_keys (
166- script_key_id BIGINT PRIMARY KEY ,
166+ script_key_id INTEGER PRIMARY KEY ,
167167
168168 -- The actual internal key here that we hold the private key for. Applying
169169 -- the tweak to this gives us the tweaked_script_key.
@@ -184,7 +184,7 @@ CREATE TABLE IF NOT EXISTS script_keys (
184184-- asset, along with the sibling taproot hash needed to properly reveal and
185185-- spend the asset.
186186CREATE TABLE IF NOT EXISTS assets (
187- asset_id BIGINT PRIMARY KEY ,
187+ asset_id INTEGER PRIMARY KEY ,
188188
189189 genesis_id BIGINT NOT NULL REFERENCES genesis_assets(gen_asset_id),
190190
@@ -225,7 +225,7 @@ CREATE TABLE IF NOT EXISTS assets (
225225-- asset. This then references the script key of an asset, creation a one to
226226-- many relationship.
227227CREATE TABLE IF NOT EXISTS asset_witnesses (
228- witness_id BIGINT PRIMARY KEY ,
228+ witness_id INTEGER PRIMARY KEY ,
229229
230230 asset_id BIGINT NOT NULL REFERENCES assets(asset_id) ON DELETE CASCADE ,
231231
@@ -243,7 +243,7 @@ CREATE TABLE IF NOT EXISTS asset_witnesses (
243243);
244244
245245CREATE TABLE IF NOT EXISTS asset_proofs (
246- proof_id BIGINT PRIMARY KEY ,
246+ proof_id INTEGER PRIMARY KEY ,
247247
248248 -- We enforce that this value is unique so we can use an UPSERT to update a
249249 -- proof file that already exists.
@@ -260,7 +260,7 @@ CREATE TABLE IF NOT EXISTS asset_proofs (
260260-- minting transaction which once signed and broadcast will actually create the
261261-- assets.
262262CREATE TABLE IF NOT EXISTS asset_minting_batches (
263- batch_id BIGINT PRIMARY KEY REFERENCES internal_keys(key_id),
263+ batch_id INTEGER PRIMARY KEY REFERENCES internal_keys(key_id),
264264
265265 -- TODO(roasbeef): make into proper enum table or use check to ensure
266266 -- proper values
@@ -281,7 +281,7 @@ CREATE INDEX IF NOT EXISTS batch_state_lookup on asset_minting_batches (batch_st
281281-- asset_seedlings are budding assets: the contain the base asset information
282282-- need to create an asset, but doesn't yet have a genesis point.
283283CREATE TABLE IF NOT EXISTS asset_seedlings (
284- seedling_id BIGINT PRIMARY KEY ,
284+ seedling_id INTEGER PRIMARY KEY ,
285285
286286 -- TODO(roasbeef): data redundant w/ genesis_assets?
287287 -- move into asset details table?
0 commit comments