test/schema.sql
OpenClaw Agent 1ea5ac60cc
All checks were successful
Deploy to dev.bl.pixeldev.eu / deploy (push) Successful in 5s
feat: Postgres CRUD backend for card text field
- schema.sql: card_text table (single-row, id=1) with content + updated_at
- server.js: Express + pg server with CRUD API:
    GET    /api/text  — read current text
    PUT    /api/text  — create / update text
    DELETE /api/text  — reset to default lorem ipsum
- package.json: express + pg dependencies (converts project to Node type)
- index.html: card now loads text from DB, inline Edit / Save / Cancel
  controls, Reset button with confirm dialog, last-updated timestamp

DB: testapp (appuser) on localhost:5432

Closes #8
2026-03-13 15:12:51 +00:00

14 lines
596 B
SQL

-- schema.sql — test project
-- Run against the "testapp" Postgres database
CREATE TABLE IF NOT EXISTS card_text (
id INT PRIMARY KEY DEFAULT 1,
content TEXT NOT NULL DEFAULT '',
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
-- Seed default row (idempotent)
INSERT INTO card_text (id, content)
VALUES (1, 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.')
ON CONFLICT (id) DO NOTHING;