Add postgresql migration files

This commit is contained in:
Yaacov Akiba Slama
2020-08-16 12:15:02 +03:00
parent 5ec237e4a4
commit a6c770462d
8 changed files with 20 additions and 0 deletions

View File

View File

View File

@@ -0,0 +1,5 @@
CREATE TABLE public.payments (
payment_hash bytea NOT NULL,
payment_request_out varchar NOT NULL,
CONSTRAINT payments_pkey PRIMARY KEY (payment_hash)
);

View File

@@ -0,0 +1 @@
DROP TABLE public.payments;

View File

@@ -0,0 +1,5 @@
ALTER TABLE public.payments DROP COLUMN payment_secret;
ALTER TABLE public.payments DROP COLUMN destination;
ALTER TABLE public.payments DROP COLUMN incoming_amount_msat;
ALTER TABLE public.payments DROP COLUMN outgoing_amount_msat;
ALTER TABLE public.payments ADD payment_request_out varchar NOT NULL;

View File

@@ -0,0 +1,5 @@
ALTER TABLE public.payments DROP COLUMN payment_request_out;
ALTER TABLE public.payments ADD payment_secret bytea NOT NULL;
ALTER TABLE public.payments ADD destination bytea NOT NULL;
ALTER TABLE public.payments ADD incoming_amount_msat bigint NOT NULL;
ALTER TABLE public.payments ADD outgoing_amount_msat bigint NOT NULL;

View File

@@ -0,0 +1,2 @@
ALTER TABLE public.payments DROP COLUMN funding_tx_id;
ALTER TABLE public.payments DROP COLUMN funding_tx_outnum;

View File

@@ -0,0 +1,2 @@
ALTER TABLE public.payments ADD funding_tx_id bytea NULL;
ALTER TABLE public.payments ADD funding_tx_outnum int NULL;