Spaces:
Running
Running
File size: 566 Bytes
c33971d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | -- 0004_webhooks.sql
CREATE TABLE IF NOT EXISTS merchant_webhooks (
webhook_id VARCHAR PRIMARY KEY,
merchant_id VARCHAR NOT NULL REFERENCES merchants(merchant_id) ON DELETE CASCADE,
url TEXT NOT NULL,
secret VARCHAR NOT NULL,
events JSONB NOT NULL DEFAULT '["order.created", "order.shipped", "order.delivered", "order.disputed", "risk.alert"]'::jsonb,
is_active BOOLEAN NOT NULL DEFAULT TRUE,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX IF NOT EXISTS idx_webhooks_merchant ON merchant_webhooks(merchant_id);
|