Skip to content

Protect serverless migration metadata operations interacting with metadata #12739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 19, 2025

Conversation

prastoin
Copy link
Contributor

@prastoin prastoin commented Jun 19, 2025

Introduction

This migration has been introduced in 0.54 we should determine how we wanna handle retro-compatibility with this, might not wanna merge this one latest main 🤔 but only a new 0.54 patch

related to #12651 (comment)

Concerns

If a workspace fails this migration that's not a good sign, the metadata schema should be completely empty since 0.54 metadata merge into core migration.
Please review you existing entries in the schema and verify they exists in the dest core one

Or maybe the schema just exists, empty, just like a shell because we didnot drop it yeat :p

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Enhanced defensive handling in database migration to safely move enum types from 'metadata' to 'core' schema, specifically preventing errors during serverlessFunction table modifications.

  • Added existence check before moving each enum type from 'metadata' schema to prevent errors with non-existent types
  • Improved schema migration reliability by handling each enum type separately instead of bulk ALTER TYPE operations
  • Modified handling of 'syncStatus' enum removal from serverlessFunction table to prevent migration failures

1 file reviewed, no comments
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

🚀 Preview Environment Ready!

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

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

@charlesBochet charlesBochet merged commit 5c118b9 into main Jun 19, 2025
45 of 46 checks passed
@charlesBochet charlesBochet deleted the fix-migration-command-metadata-alter branch June 19, 2025 15:09
abdulrahmancodes pushed a commit to abdulrahmancodes/twenty that referenced this pull request Jun 19, 2025
…adata (twentyhq#12739)

# Introduction

This migration has been introduced in 0.54 we should determine how we
wanna handle retro-compatibility with this, might not wanna merge this
one latest main 🤔 but only a new 0.54 patch

related to
twentyhq#12651 (comment)

## Concerns
If a workspace fails this migration that's not a good sign, the metadata
schema should be completely empty since 0.54 `metadata` merge into
`core` migration.
Please review you existing entries in the schema and verify they exists
in the dest `core` one
prastoin added a commit that referenced this pull request Jun 19, 2025
…adata (#12739)

# Introduction

This migration has been introduced in 0.54 we should determine how we
wanna handle retro-compatibility with this, might not wanna merge this
one latest main 🤔 but only a new 0.54 patch

related to
#12651 (comment)

## Concerns
If a workspace fails this migration that's not a good sign, the metadata
schema should be completely empty since 0.54 `metadata` merge into
`core` migration.
Please review you existing entries in the schema and verify they exists
in the dest `core` one
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.

2 participants