chore(directus): update production schema snapshot - #251
chore(directus): update production schema snapshot#251github-actions[bot] wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Note
Copilot could not run the full agentic suite for this review because it was automatically requested on a bot-authored pull request. Request a review from Copilot under Reviewers to retry with the full agentic suite. Improved support for bot-authored pull requests is coming soon.
This PR updates the Directus CMS schema to introduce/expand support for ticket invoice documents and reorganize the ticketing collections accordingly.
Changes:
- Adds/rewires the
ticket_invoicescollection configuration and fields (invoice metadata, file, related invoice linking, snapshot). - Reorders/updates
ticket_ordersandticketscollection metadata to match the new ticketing model and UI grouping/sorting. - Updates relationships/constraints between orders, invoices, tickets, and files.
Suppressed comments (5)
directus-cms/schema.json:1
archive_app_filteris enabled whilearchive_field/archive_valueare null. In Directus this configuration is internally inconsistent and can lead to incorrect/undefined “archived” filtering behavior in the App. Either disablearchive_app_filterforticket_invoicesor configure a proper archive field/value pair.
directus-cms/schema.json:1- The field name
orderis a SQL reserved keyword and can cause quoting/compatibility issues in queries, migrations, or tooling. Prefer renaming this column to something unambiguous likeorder_id/ticket_orderand update the corresponding relation + templates accordingly.
directus-cms/schema.json:1 - The relation metadata says
one_deselect_action: "nullify", but the FK is configured ason_delete: "NO ACTION"(and theorderfield is marked required / non-nullable elsewhere). These settings conflict: “nullify” isn’t possible if deletes are restricted and/or the FK can’t be set to null. Align the three pieces (Directus meta action, DBon_delete, and column nullability) so they represent the same behavior (e.g., restrict deletes + removenullify, or allow nullification by making the column nullable and usingSET NULL).
directus-cms/schema.json:1 invoice_numberis markedrequired: trueandreadonly: truein the Directus meta. Unless this field is always populated automatically (e.g., via Flow/Hook/API-only creation), this can block creating invoices via the Directus App because users can’t enter a required value. If invoices are system-generated, consider also making creation in the App impossible/hidden (or document the automation), or relax eitherrequiredorreadonlyto match the intended operational workflow.
directus-cms/schema.json:1- The
typefield is markedsearchable: truebut is not indexed (is_indexed: false). If the invoices table grows and the UI/API commonly filters bytype, this can become a frequent sequential scan. Consider adding an index onticket_invoices.typeif filtering/sorting by document type is expected to be common.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
💡 Codex Review
https://github.com/programmierbar/website/blob/1383eea7d8a29b111563039f35d844903a01da4c/directus-cms/schema.json#L37452-L37453
Restore the invoice creator foreign key
When this snapshot is applied, ticket_invoices.user_created is now defined as a bare UUID, and the snapshot's relations array has no corresponding relation to directus_users. The invoice correction/cancellation flow relies on this field to retain the acting administrator, so invalid or deleted user IDs can orphan that audit attribution and Directus cannot expose it as a real relation. Preserve the foreign key and add the corresponding relation before accepting this production drift.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
1383eea to
1b78d2d
Compare
| "collection": "ticket_invoices", | ||
| "field": "sent_at", | ||
| "type": "timestamp", | ||
| "meta": { | ||
| "collection": "ticket_orders", | ||
| "collection": "ticket_invoices", | ||
| "conditions": null, | ||
| "display": "raw", | ||
| "display_options": null, | ||
| "field": "company_name", | ||
| "display": "datetime", | ||
| "display_options": { | ||
| "relative": true | ||
| }, | ||
| "field": "sent_at", | ||
| "group": null, | ||
| "hidden": false, | ||
| "interface": "input", | ||
| "note": "Company name (for company purchases)", | ||
| "interface": "datetime", | ||
| "note": "When this document was sent to the customer — set automatically for the confirmation email; once set, the document counts as issued and becomes immutable", | ||
| "options": null, | ||
| "readonly": false, | ||
| "required": false, | ||
| "searchable": true, |
1b78d2d to
db91bab
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
Suppressed comments (1)
directus-cms/schema.json:37333
ticket_invoices.sent_atis described as making the document “issued and immutable once set”, but the field is not marked readonly in the schema metadata. If this immutability should be enforced in the admin UI, setreadonly: true(and/or enforce via permissions/hooks).
| "one_collection": "ticket_orders", | ||
| "one_collection_field": null, | ||
| "one_deselect_action": "nullify", | ||
| "one_field": null, | ||
| "one_field": "invoices", | ||
| "sort_field": null |
| "interface": "list-o2m", | ||
| "note": "Invoice documents issued for this order", | ||
| "options": { | ||
| "template": "{{invoice_number}} ({{type}})", | ||
| "enableCreate": false | ||
| "enableCreate": false, | ||
| "template": "{{invoice_number}} ({{type}})" |
Automated update of
directus-cms/schema.jsonfrom the production/schema/snapshotendpoint. Review the diff for unexpected schema driftbefore merging.
Triggered by the Update Directus schema snapshot workflow.