diff --git a/src/Simplex/Chat/Store/Postgres/Migrations/chat_schema.sql b/src/Simplex/Chat/Store/Postgres/Migrations/chat_schema.sql index a94a6c0baf..fee1dd342b 100644 --- a/src/Simplex/Chat/Store/Postgres/Migrations/chat_schema.sql +++ b/src/Simplex/Chat/Store/Postgres/Migrations/chat_schema.sql @@ -299,12 +299,14 @@ ALTER TABLE test_chat_schema.badge_purchases ALTER COLUMN badge_purchase_id ADD CREATE TABLE test_chat_schema.badge_store_receipts ( badge_store_receipt_id bigint NOT NULL, user_id bigint NOT NULL, - provider text NOT NULL, - transaction_ref text NOT NULL, + invoice_id text, + provider text, + transaction_ref text, purchase_key bytea NOT NULL, purchase_priv_key bytea NOT NULL, master_key bytea NOT NULL, - created_at timestamp with time zone NOT NULL + created_at timestamp with time zone NOT NULL, + closed_at timestamp with time zone ); @@ -1818,6 +1820,11 @@ ALTER TABLE ONLY test_chat_schema.badge_purchases +ALTER TABLE ONLY test_chat_schema.badge_store_receipts + ADD CONSTRAINT badge_store_receipts_invoice_id_key UNIQUE (invoice_id); + + + ALTER TABLE ONLY test_chat_schema.badge_store_receipts ADD CONSTRAINT badge_store_receipts_pkey PRIMARY KEY (badge_store_receipt_id);