Drop leftover trust center page_title columns - #1596
Draft
gearnode wants to merge 1 commit into
Draft
Conversation
Organization create inserts only entity_name. Installs stuck with the older NOT NULL page_title (or title) column after a skipped rename fail with SQLSTATE 23502. Make the rename/backfill/entity migrations idempotent and add a repair migration that ensures entity_name exists and drops obsolete branding columns. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Organization create fails when
trust_centersstill has the obsolete NOT NULLpage_title(ortitle) column:Inserts only populate
entity_name. Branding briefly lived aspage_title→title→entity_name; installs that skipped the rename can keep the old NOT NULL column besideentity_name, so new portal rows violate the constraint.Changes
page_title→titlerename idempotenttitleorpage_titleentity_nameentity_nameexists and drops leftoverpage_title/titleTest plan
entity_nameremainspage_title+entity_name) → repair dropspage_title; insert withentity_namesucceedspage_title-only schema → repair addsentity_namefrompage_titleand drops the old columnentity_name-only schemaSummary by cubic
Fixes org creation failures by removing leftover NOT NULL
page_title/titlecolumns intrust_centersand making migrations idempotent. Ensures onlyentity_nameis used going forward.Coredata
+142-12page_title→titlerename idempotent.titleorpage_titleif present.entity_name, droptitleandpage_titlewith IF EXISTS.entity_namefromorganizations.name,page_title, ortitle, then drop obsolete columns.Written for commit c94de82. Summary will update on new commits.