Files
pagodera/lib/db/migrations/007_escrow_deposits.sql
T
Evandro Fonseca Junior 55eebde0ba feat: add user authentication UI to header component
Add login and register dialogs, user dropdown menu with profile link and logout option, and integrate with session management hook. Prevent hydration mismatches by conditionally rendering auth elements after mount. Update package-lock.json with new @esbuild dependencies for build tooling.
2025-11-04 02:33:29 -03:00

23 lines
982 B
SQL

-- Migration 007: Tabela de depósitos em escrow
-- Criado em: 2025-01-27
-- Tabela de depósitos em escrow
CREATE TABLE IF NOT EXISTS escrow_deposits (
deposit_id SERIAL PRIMARY KEY,
transaction_id INTEGER NOT NULL REFERENCES transactions(transaction_id) ON DELETE CASCADE,
depositor_id INTEGER NOT NULL REFERENCES users(user_id),
amount DECIMAL(10, 2) NOT NULL,
payment_method VARCHAR(20),
payment_proof_url TEXT,
deposit_status VARCHAR(20) DEFAULT 'pending' CHECK (deposit_status IN ('pending', 'confirmed', 'released', 'refunded')),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
confirmed_at TIMESTAMP,
released_at TIMESTAMP
);
-- Índices para performance
CREATE INDEX IF NOT EXISTS idx_escrow_deposits_transaction ON escrow_deposits(transaction_id);
CREATE INDEX IF NOT EXISTS idx_escrow_deposits_depositor ON escrow_deposits(depositor_id);
CREATE INDEX IF NOT EXISTS idx_escrow_deposits_status ON escrow_deposits(deposit_status);