fedimovies/mitra-models/migrations/V0030__invoice.sql

11 lines
448 B
MySQL
Raw Normal View History

2022-08-24 19:36:57 +00:00
CREATE TABLE invoice (
id UUID PRIMARY KEY,
sender_id UUID NOT NULL REFERENCES actor_profile (id) ON DELETE CASCADE,
recipient_id UUID NOT NULL REFERENCES user_account (id) ON DELETE CASCADE,
chain_id VARCHAR(50) NOT NULL,
payment_address VARCHAR(200) NOT NULL,
invoice_status SMALLINT NOT NULL DEFAULT 1,
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE (chain_id, payment_address)
);