Database Schema Designer Skill for Library Loans in Claude Code
Translate relationships and business rules into PostgreSQL tables, then verify valid and invalid inserts in a local test database.
中文Install in Claude Code
Use a disposable PostgreSQL database and a short list of entity, cardinality, and date requirements.
- Get the complete `plugins/database/database-schema-designer/skills/designing-database-schemas` directory from the pinned GitHub commit.
- Copy it into the target project's `.claude/skills/`. Check `.claude/skills/designing-database-schemas/SKILL.md`, start Claude Code at the project root, and call `/designing-database-schemas`.
Example task
Create one book and two physical copies. Insert a valid loan, then try a missing copy ID and a due_on value earlier than checkout_on.What to check
The valid loan persists. The other inserts fail with the foreign-key and date check constraints respectively, and the schema can be recreated from scratch.
Original SKILL.md on GitHub · Updated
Frequently asked question
Should a loan reference a book or a physical copy?
Reference the copy so borrowing status is tracked per physical item. Resolve the book through the copy relation.