mirror of
https://github.com/yzernik/squeaknode.git
synced 2026-08-14 12:43:24 +02:00
Add offer table (#229)
* Add offer table to db schema * Add offer table to db schema * Add sent payment table
This commit is contained in:
parent
fc08f74801
commit
4e58415299
1 changed files with 28 additions and 0 deletions
28
init.sql
28
init.sql
|
|
@ -42,3 +42,31 @@ CREATE TABLE IF NOT EXISTS peer (
|
|||
uploading BOOLEAN NOT NULL,
|
||||
downloading BOOLEAN NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS offer (
|
||||
offer_id SERIAL PRIMARY KEY,
|
||||
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
squeak_hash CHAR(64) NOT NULL,
|
||||
key_cipher bytea NOT NULL,
|
||||
iv bytea NOT NULL,
|
||||
preimage_hash CHAR(64) NOT NULL,
|
||||
amount INTEGER NOT NULL,
|
||||
payment_request TEXT NOT NULL,
|
||||
node_pubkey VARCHAR(66) NOT NULL,
|
||||
node_host VARCHAR(256) NOT NULL,
|
||||
node_port INTEGER NOT NULL,
|
||||
peer_id INTEGER NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS sent_payment (
|
||||
sent_payment_id SERIAL PRIMARY KEY,
|
||||
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
offer_id INTEGER NOT NULL,
|
||||
peer_id INTEGER NOT NULL,
|
||||
squeak_hash CHAR(64) NOT NULL,
|
||||
preimage_hash CHAR(64) NOT NULL,
|
||||
preimage CHAR(64) NOT NULL,
|
||||
amount INTEGER NOT NULL,
|
||||
node_pubkey VARCHAR(66) NOT NULL,
|
||||
preimage_is_valid BOOLEAN NOT NULL
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue