-- +goose Up
CREATE TABLE IF NOT EXISTS requests_for_suppliers (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    user_id INT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
    request_txt TEXT,
    generated_tz BOOLEAN DEFAULT false,
    final_tz TEXT,
    generated_final_tz BOOLEAN DEFAULT false,
    final_update_tz TEXT,
    mailling_status_id INT REFERENCES mailing_status(id) DEFAULT 1,
    created_at TIMESTAMP DEFAULT now()
);

CREATE INDEX IF NOT EXISTS idx_requests_user_id ON requests_for_suppliers(user_id);
CREATE INDEX IF NOT EXISTS idx_requests_status ON requests_for_suppliers(mailling_status_id);

-- +goose Down
DROP TABLE requests_for_suppliers;
