Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions db/sqlc/migrations/000001_accounts.down.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
DROP INDEX IF EXISTS account_invoices_unique;
DROP INDEX IF EXISTS account_payments_unique;
DROP TABLE IF EXISTS account_payments;
DROP TABLE IF EXISTS account_invoices;
DROP TABLE IF EXISTS account_indices;
Expand Down
12 changes: 8 additions & 4 deletions db/sqlc/migrations/000001_accounts.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ CREATE TABLE IF NOT EXISTS account_payments (

-- The total amount of the payment in millisatoshis.
-- This includes the payment amount and estimated routing fee.
full_amount_msat BIGINT NOT NULL,
full_amount_msat BIGINT NOT NULL
);

UNIQUE(account_id, hash)
CREATE UNIQUE INDEX account_payments_unique ON account_payments (
account_id, hash
);

-- The account_invoices table stores all the invoice payment hashes that
Expand All @@ -55,9 +57,11 @@ CREATE TABLE IF NOT EXISTS account_invoices (
account_id BIGINT NOT NULL REFERENCES accounts(id) ON DELETE CASCADE,

-- The payment hash of the invoice.
hash BLOB NOT NULL,
hash BLOB NOT NULL
);

UNIQUE(account_id, hash)
CREATE UNIQUE INDEX account_invoices_unique ON account_invoices (
account_id, hash
);

-- The account_indices table stores any string-to-integer mappings that are
Expand Down
Loading