-- Initialize the Todo database
CREATE DATABASE IF NOT EXISTS tododb;

\c tododb;

CREATE TABLE IF NOT EXISTS todos (
    id        SERIAL PRIMARY KEY,
    title     TEXT        NOT NULL,
    done      BOOLEAN     NOT NULL DEFAULT FALSE,
    created_at TIMESTAMP  NOT NULL DEFAULT CURRENT_TIMESTAMP
);

-- Seed some sample data
INSERT INTO todos (title, done) VALUES
    ('Deploy app to Kubernetes',    TRUE),
    ('Set up PostgreSQL StatefulSet', TRUE),
    ('Configure PersistentVolume',   FALSE),
    ('Write README documentation',   FALSE),
    ('Test the web application',     FALSE);
