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.
22 lines
970 B
SQL
22 lines
970 B
SQL
-- Migration 009: Tabela de histórico de preços de itens
|
|
-- Criado em: 2025-01-27
|
|
|
|
-- Tabela de histórico de preços
|
|
CREATE TABLE IF NOT EXISTS item_price_history (
|
|
price_history_id SERIAL PRIMARY KEY,
|
|
item_id INTEGER NOT NULL,
|
|
item_name VARCHAR(255) NOT NULL,
|
|
server_name VARCHAR(50),
|
|
price_amount DECIMAL(10, 2) NOT NULL,
|
|
price_type VARCHAR(20) CHECK (price_type IN ('pix', 'tibia_coins', 'gold_coins')),
|
|
transaction_id INTEGER REFERENCES transactions(transaction_id),
|
|
recorded_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
-- Índices para performance
|
|
CREATE INDEX IF NOT EXISTS idx_price_history_item ON item_price_history(item_id, recorded_at DESC);
|
|
CREATE INDEX IF NOT EXISTS idx_price_history_server ON item_price_history(server_name);
|
|
CREATE INDEX IF NOT EXISTS idx_price_history_transaction ON item_price_history(transaction_id);
|
|
CREATE INDEX IF NOT EXISTS idx_price_history_recorded_at ON item_price_history(recorded_at DESC);
|
|
|