create-system introspects a live PostgreSQL schema and generates a complete WinterCMS plugin skeleton: models, migrations, backend controllers, list/form field definitions, and language files. The schema is the single source of truth — annotate your DDL with YAML comments to control every aspect of the generated output.
- Connects to a PostgreSQL database and reads the schema (tables, columns, foreign keys, constraints, triggers).
- Classifies each table by structural pattern:
ContentTable,PivotTable,SemiPivotTable,CentralTable,ReportTable. - Infers ORM relation types from FK structure (BelongsTo, HasMany, BelongsToMany, etc.).
- Generates a full WinterCMS plugin directory under
plugins/<author>/<name>/. - Optionally commits and pushes the generated plugin via git.
# From your WinterCMS root, with the schema already migrated:
/path/to/acorn-create-system myplugin
# Generate all plugins detected in the schema:
/path/to/acorn-create-system all
# Generate and push to git:
/path/to/acorn-create-system myplugin pushgit clone https://github.com/anewholm/create-system /var/www/scripts/acorn-create-system-dir
composer install -d /var/www/scripts/acorn-create-system-dirOr clone the scripts repo which includes this tool alongside the broader WinterCMS setup scripts.
- PHP 8.1+
- PostgreSQL 12+ (must be running and accessible)
- Composer
- WinterCMS installation (the generated output targets WinterCMS 1.2+)
Table, column, and FK comments in PostgreSQL can contain YAML fragments to control generation. See PATTERNS.md for the full catalogue of patterns and their YAML keys.
-- table comment
COMMENT ON TABLE acorn_calendar_events IS 'table-type: content
label: Event
label_plural: Events';
-- column comment
COMMENT ON COLUMN acorn_calendar_events.name IS 'field-type: text
tab: details';
-- FK comment
COMMENT ON CONSTRAINT event_location_id_fkey ON acorn_calendar_events IS 'type: Xto1
read-only: true';For a table acorn_myapp_widgets the generator produces:
plugins/acorn/myapp/
models/
Widget.php
widget/
columns.yaml
fields.yaml
controllers/
Widgets.php
widgets/
list.htm
update.htm
create.htm
lang/
en/
lang.php
updates/
create_acorn_myapp_widgets_table.php
version.yaml
Plugin.php
PATTERNS.md documents every pattern the tool recognises — table classification, relation type inference, field rendering, OLAP support, and YAML override keys. This is the design reference for extending or modifying the generator.
| PHP | PostgreSQL | WinterCMS output target |
|---|---|---|
| 8.1+ | 12+ | 1.2+ (Laravel 9/10/11) |
- anewholm/scripts — setup scripts that install WinterCMS environments for generated plugins
- anewholm/acorn — base module that generated plugins extend
MIT