Skip to content

Apply schema changes to CRUD UI workspace data#50

Merged
eviltester merged 1 commit into
masterfrom
codex/48-schema-workspace-upgrade
Jul 15, 2026
Merged

Apply schema changes to CRUD UI workspace data#50
eviltester merged 1 commit into
masterfrom
codex/48-schema-workspace-upgrade

Conversation

@eviltester

Copy link
Copy Markdown
Owner

Summary

Closes #48.

Adds a safe Schema Edit apply-to-workspace flow for the CRUD UI. The flow validates a draft schema, previews migration impact, allows explicit mapping of renamed entities, fields, and relationships, and applies the migrated workspace only after confirmation.

What Changed

  • Added /ui/schema/upgrade/preview and /ui/schema/upgrade/apply routes.
  • Added WorkspaceSchemaUpgradeService for draft validation, migration preview, row and relationship edge migration, type coercion reporting, fallback/default value assignment reporting, stale workspace version checks, and atomic workspace replacement.
  • Added an Apply to Workspace dialog workflow with Refresh Preview, Confirm Apply, and Cancel.
  • Added mapping controls for entities, fields, and relationships.
  • Kept new fields/defaults separate from true coercions in the migration report.
  • Made the ER diagram horizontal layout the default.
  • Added focused service/controller tests for preview/apply behavior and UI wiring.

Validation

  • node --check thingifier-crud-ui\src\main\resources\public\assets\app.js
  • mvn -pl thingifier-crud-ui "-Dtest=CrudUiControllerTest" test
  • mvn -pl thingifier-crud-ui "-Dtest=WorkspaceSchemaUpgradeServiceTest,CrudUiControllerTest" test
  • mvn -pl thingifier-crud-ui -am test
  • mvn -pl thingifier-crud-ui -DskipTests checkstyle:check@project-fqn-check
  • mvn spotless:check
  • mvn -pl thingifier-crud-ui -am -DskipTests package

Copilot AI review requested due to automatic review settings July 15, 2026 15:55

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@eviltester
eviltester merged commit c364d00 into master Jul 15, 2026
3 checks passed

@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

Here are some automated review suggestions for this pull request.

Reviewed commit: a18d6f6ca3

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +833 to +835
for (var relationship : source.relationships()) {
if (relationship.fromEntityName().equals(mapping.sourceFromEntity())
&& relationship.name().equals(mapping.sourceName())) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve mappings to reverse relationship aliases

When the user maps a target relationship to a reverse relationship name exposed by the workspace metadata, such as todo|task-of after changing the relationship direction, this check never recognizes it because source.relationships() only contains the forward schema definitions. The manual mapping is then ignored and the migration drops those existing edges even though the UI offered the reverse relationship as a selectable source; consider matching relationship.reverse() with swapped endpoints too.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CRUD UI app - schema changes can be fed into workspace to update the data

2 participants