diff --git a/postgresql/migrations/000000_.down.sql b/postgresql/migrations/000000_.down.sql new file mode 100644 index 0000000..e69de29 diff --git a/postgresql/migrations/000000_.up.sql b/postgresql/migrations/000000_.up.sql new file mode 100644 index 0000000..e69de29 diff --git a/postgresql/migrations/000001_create_paymens_table.up.sql b/postgresql/migrations/000001_create_paymens_table.up.sql new file mode 100644 index 0000000..19cbdeb --- /dev/null +++ b/postgresql/migrations/000001_create_paymens_table.up.sql @@ -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) +); \ No newline at end of file diff --git a/postgresql/migrations/000001_create_payments_table.down.sql b/postgresql/migrations/000001_create_payments_table.down.sql new file mode 100644 index 0000000..8baef0d --- /dev/null +++ b/postgresql/migrations/000001_create_payments_table.down.sql @@ -0,0 +1 @@ +DROP TABLE public.payments; \ No newline at end of file diff --git a/postgresql/migrations/000002_details.down.sql b/postgresql/migrations/000002_details.down.sql new file mode 100644 index 0000000..b559ed4 --- /dev/null +++ b/postgresql/migrations/000002_details.down.sql @@ -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; \ No newline at end of file diff --git a/postgresql/migrations/000002_details.up.sql b/postgresql/migrations/000002_details.up.sql new file mode 100644 index 0000000..68d95fa --- /dev/null +++ b/postgresql/migrations/000002_details.up.sql @@ -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; \ No newline at end of file diff --git a/postgresql/migrations/000003_funding_tx.down.sql b/postgresql/migrations/000003_funding_tx.down.sql new file mode 100644 index 0000000..c6da088 --- /dev/null +++ b/postgresql/migrations/000003_funding_tx.down.sql @@ -0,0 +1,2 @@ +ALTER TABLE public.payments DROP COLUMN funding_tx_id; +ALTER TABLE public.payments DROP COLUMN funding_tx_outnum; \ No newline at end of file diff --git a/postgresql/migrations/000003_funding_tx.up.sql b/postgresql/migrations/000003_funding_tx.up.sql new file mode 100644 index 0000000..df40ee6 --- /dev/null +++ b/postgresql/migrations/000003_funding_tx.up.sql @@ -0,0 +1,2 @@ +ALTER TABLE public.payments ADD funding_tx_id bytea NULL; +ALTER TABLE public.payments ADD funding_tx_outnum int NULL; \ No newline at end of file