Skip to content

Conversation

@prastoin
Copy link
Contributor

@prastoin prastoin commented Nov 10, 2025

Introduction

In this PR we're migration the syncable entity to have required applicationId and universalIdenfitier.
It has several impacts:

  • Refactor the sync metadata to be passing the twenty standard application id of the current workspace
  • Upgrade commands in order to migrate existing workspace's entity for the migration to be run successfully

API Metadata

Any operation going through the api metadata nows automatically scope the related entity to the workspace custom application instance. This breaks the existing "hack" implementation of the synchronize application service that calls all the services atomically.

We need to either ignore the tests or remove the cli status check from the blocking status badges for a PR to be merged

New workspace

Already handled in previous #15625, when a workspace is created it gets created a twenty standard and custom workspace instance

Existing workspace

  • Fails the migration ( swallowed )
  • Passes the upgrade commands that: creates standard app, associate standard entities to it and set their universalIdentifier to their standardId ( not all though ). Creates a custom workspace applications and associate all non app associated yet entities to the workspace custom app

FlatApplication

Introduced the flatApplication and cache. It's a bit hacky right now but will migrate existing MetadataName to be SyncableMetadataName in a following PR

V1 Deprecation

Official v1 deprecation as it hasn't been refactored to handle new required appid and universalId
Will remove the code after this PR

Strategy

Sync-metadata governance

The sync metadata has been modified to still allow workspace creation after we apply the required applicationId and universalIdentifier migration
It handles the synchronization of those fields for the following entities:

  • Objects
  • Fields
  • Roles
  • Agents
  • Indexes (only create and delete, update will be handled by an upgrade command as it's not supported by the sync metadata )

@github-actions
Copy link
Contributor

github-actions bot commented Nov 10, 2025

TODOs/FIXMEs:

  • // TODO prastoin: packages/twenty-server/src/engine/core-modules/workspace/workspace.entity.ts

Generated by 🚫 dangerJS against 26072e5

@github-actions
Copy link
Contributor

github-actions bot commented Nov 10, 2025

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:56854

This environment will automatically shut down when the PR is closed or after 5 hours.

@prastoin
Copy link
Contributor Author

I need to remove v1 code source before this

@prastoin prastoin closed this Nov 14, 2025
@prastoin
Copy link
Contributor Author

Blocked by #15823

@prastoin prastoin reopened this Nov 17, 2025
@prastoin prastoin force-pushed the migration-and-upgrade-command-twenty-apps branch from 86bb7b7 to 678ad3a Compare November 17, 2025 10:38
@prastoin prastoin force-pushed the migration-and-upgrade-command-twenty-apps branch from 971a828 to fcf3c71 Compare November 17, 2025 18:16
@prastoin
Copy link
Contributor Author

I need to refactor migrations command to be handling view universal id and view universal id but also handle the field metadata are some standardId seems ot be invalid by definition but has never been consumed before

@prastoin
Copy link
Contributor Author

I don't like what's happening here
Even though it works at some point it's not the good strategy in the end
We should not hack in the sync metadata at all
If it's not only being thankful for his loyal services so far
I will now tend to describe a json twenty standard configuration as const server side and generate and maintain a workspace migration from it and programmatically run them on a workspace creation

@prastoin
Copy link
Contributor Author

It's not only lost but will restart from scratch

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.

3 participants