Example schemas
18 realistic .forge applications exercising the schema language across many domains. Some are adapted from well-known open-source apps and classic sample databases; others are synthetic. Every one passes validate --strict and generate all.
HR Directory
AdaptedGeo hierarchy, employee self-reference, a mutual FK cycle, and temporal job history — the small intro example.
Music Store
AdaptedMany-to-many playlists, an InvoiceLine join-with-payload, self-referential reports_to, @soft_delete, money as i64 cents.
Wholesale Orders
AdaptedAn OrderDetail join with a discount payload, self-referential employees, multi-FK orders, and composite indexes.
DVD Rental
AdaptedTwo many-to-many relations on one model, dual FK to the same model, a store↔staff mutual cycle, and a geo chain — the most complex example.
Code Hosting
AdaptedFork-lineage self-reference, PR head/base dual FK, org/team RBAC joins, and issue↔label many-to-many.
Publishing & Membership
Adapted@fulltext, three many-to-many pairs, a subscription-billing join, and ISO currency as char(3).
Social Graph
AdaptedReply-thread self-reference, follow/block join models (dual FK to Account), and notifications.
Student Information System
SyntheticA textbook many-to-many-with-payload (Enrollment grade), section/term/course FKs, and GPA constraints.
Healthcare
SyntheticAppointments, role-as-string providers, prescriptions and diagnoses, and a composite scheduling index.
Hotel Reservations
SyntheticA RoomType template vs Room inventory split, date-range availability, and i64 money.
Food Delivery
SyntheticA struct GeoPoint (required + optional), an OrderItem join, and a timestamped status-event audit log.
Banking Ledger
SyntheticDouble-entry transactions, a Transfer dual FK to Account, joint-account many-to-many, and char(3) currency.
Airline Reservations
SyntheticFlight dual FK to Airport, a unique-seat composite index (seat lock), and IATA codes as char(3).
Blog CMS
Syntheticsnake_case component refs (tsx:// / jsx:// / api://), self-referential comments and categories, @fulltext, and @soft_delete.
Project Management
SyntheticAn Org→Team→Project→Issue hierarchy, sub-issue self-reference, label many-to-many, and dual composite indexes.
SaaS Multi-tenant
SyntheticPer-tenant *Organization scoping, a Membership RBAC join, API keys, and an audit log.
E-commerce Store
SyntheticProduct variants, CartItem/OrderItem joins, money as i64 minor units, and SKU/order-number natural keys.
IoT Sensors
SyntheticA +u64 high-volume PK, a fixed array [f64; 3], a struct Calibration, and append-heavy telemetry.