From 22240ed36dba830378a405b5221db56365d4f7a2 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Tue, 3 Sep 2024 13:21:36 -0400 Subject: [PATCH] fix table creation order --- data/sql.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/data/sql.go b/data/sql.go index 653b372..8fc206d 100644 --- a/data/sql.go +++ b/data/sql.go @@ -61,6 +61,14 @@ CREATE TABLE IF NOT EXISTS hivemapper.mints ( CONSTRAINT fk_transaction FOREIGN KEY (transaction_id) REFERENCES hivemapper.transactions(id) ); +CREATE TABLE IF NOT EXISTS hivemapper.burns ( + id SERIAL PRIMARY KEY, + transaction_id INTEGER NOT NULL, + from_address TEXT NOT NULL, + amount DECIMAL NOT NULL, + CONSTRAINT fk_transaction FOREIGN KEY (transaction_id) REFERENCES hivemapper.transactions(id) +); + CREATE TABLE IF NOT EXISTS hivemapper.payments ( id SERIAL PRIMARY KEY, mint_id INTEGER NOT NULL, @@ -115,11 +123,4 @@ CREATE TABLE IF NOT EXISTS hivemapper.transfers ( CONSTRAINT fk_transaction FOREIGN KEY (transaction_id) REFERENCES hivemapper.transactions(id) ); -CREATE TABLE IF NOT EXISTS hivemapper.burns ( - id SERIAL PRIMARY KEY, - transaction_id INTEGER NOT NULL, - from_address TEXT NOT NULL, - amount DECIMAL NOT NULL, - CONSTRAINT fk_transaction FOREIGN KEY (transaction_id) REFERENCES hivemapper.transactions(id) -); `