-- +goose Up
CREATE SCHEMA IF NOT EXISTS fts;

CREATE TABLE fts.transactions (
    transaction_id SERIAL PRIMARY KEY,
    description TEXT NOT NULL,
    amount NUMERIC(12, 2) NOT NULL,
    category VARCHAR(50) NOT NULL,
    transaction_date TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL,
    created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL
);

-- Index for querying transactions by date
CREATE INDEX idx_transactions_date ON fts.transactions(transaction_date);

-- +goose Down
DROP INDEX IF EXISTS fts.idx_transactions_date;
DROP TABLE IF EXISTS fts.transactions;
