-- +goose Up
CREATE TABLE user_reports (
    id          BIGSERIAL PRIMARY KEY,
    created_at  TIMESTAMPTZ NOT NULL DEFAULT NOW(),
    repeater_id INTEGER NOT NULL REFERENCES repeaters(id),
    callsign    TEXT NOT NULL DEFAULT '',
    report_type TEXT NOT NULL,
    message     TEXT NOT NULL DEFAULT '',
    status      TEXT NOT NULL DEFAULT 'open',
    resolved_at TIMESTAMPTZ
);

CREATE INDEX idx_user_reports_repeater_id ON user_reports (repeater_id);
CREATE INDEX idx_user_reports_created_at ON user_reports (created_at);
CREATE INDEX idx_user_reports_status ON user_reports (status);

-- +goose Down
DROP TABLE IF EXISTS user_reports;
