generated from nholtware/service-template-express
feat: story CRUD API with validation and publishing
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b93d646be0
commit
806e893076
6 changed files with 486 additions and 0 deletions
14
migrations/0002_stories.sql
Normal file
14
migrations/0002_stories.sql
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
-- 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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue