adventure/migrations/0002_stories.sql
nholtware 806e893076
Some checks failed
/ checks (push) Failing after 35s
/ deploy (push) Has been skipped
feat: story CRUD API with validation and publishing
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 12:43:26 -06:00

14 lines
432 B
SQL

-- Up Migration
CREATE TABLE stories (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
title TEXT NOT NULL,
description TEXT NOT NULL DEFAULT '',
doc JSONB NOT NULL,
published BOOLEAN NOT NULL DEFAULT false,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX stories_published_idx ON stories (published, updated_at DESC);
-- Down Migration
DROP TABLE stories;