Skip to content

chore(directus): update production schema snapshot - #251

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
chore/directus-schema-snapshot
Open

chore(directus): update production schema snapshot#251
github-actions[bot] wants to merge 1 commit into
mainfrom
chore/directus-schema-snapshot

Conversation

@github-actions

Copy link
Copy Markdown

Automated update of directus-cms/schema.json from the production
/schema/snapshot endpoint. Review the diff for unexpected schema drift
before merging.

Triggered by the Update Directus schema snapshot workflow.

Copilot AI lite review requested due to automatic review settings August 17, 2026 05:40
@vercel

vercel Bot commented Aug 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
programmierbar-website Ready Ready Preview Aug 31, 2026 11:31am

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_invoices collection configuration and fields (invoice metadata, file, related invoice linking, snapshot).
  • Reorders/updates ticket_orders and tickets collection 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_filter is enabled while archive_field/archive_value are null. In Directus this configuration is internally inconsistent and can lead to incorrect/undefined “archived” filtering behavior in the App. Either disable archive_app_filter for ticket_invoices or configure a proper archive field/value pair.
    directus-cms/schema.json:1
  • The field name order is a SQL reserved keyword and can cause quoting/compatibility issues in queries, migrations, or tooling. Prefer renaming this column to something unambiguous like order_id / ticket_order and update the corresponding relation + templates accordingly.
    directus-cms/schema.json:1
  • The relation metadata says one_deselect_action: "nullify", but the FK is configured as on_delete: "NO ACTION" (and the order field 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, DB on_delete, and column nullability) so they represent the same behavior (e.g., restrict deletes + remove nullify, or allow nullification by making the column nullable and using SET NULL).
    directus-cms/schema.json:1
  • invoice_number is marked required: true and readonly: true in 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 either required or readonly to match the intended operational workflow.
    directus-cms/schema.json:1
  • The type field is marked searchable: true but is not indexed (is_indexed: false). If the invoices table grows and the UI/API commonly filters by type, this can become a frequent sequential scan. Consider adding an index on ticket_invoices.type if 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

https://github.com/programmierbar/website/blob/1383eea7d8a29b111563039f35d844903a01da4c/directus-cms/schema.json#L37452-L37453
P2 Badge 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".

Copilot AI review requested due to automatic review settings August 24, 2026 05:43
@github-actions
github-actions Bot force-pushed the chore/directus-schema-snapshot branch from 1383eea to 1b78d2d Compare August 24, 2026 05:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread directus-cms/schema.json
Comment on lines +37315 to 37333
"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,
@github-actions
github-actions Bot force-pushed the chore/directus-schema-snapshot branch from 1b78d2d to db91bab Compare August 31, 2026 11:30
Copilot AI review requested due to automatic review settings August 31, 2026 11:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_at is 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, set readonly: true (and/or enforce via permissions/hooks).

Comment thread directus-cms/schema.json
Comment on lines +44559 to 44563
"one_collection": "ticket_orders",
"one_collection_field": null,
"one_deselect_action": "nullify",
"one_field": null,
"one_field": "invoices",
"sort_field": null
Comment thread directus-cms/schema.json
Comment on lines 39046 to +39050
"interface": "list-o2m",
"note": "Invoice documents issued for this order",
"options": {
"template": "{{invoice_number}} ({{type}})",
"enableCreate": false
"enableCreate": false,
"template": "{{invoice_number}} ({{type}})"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants