Skip to content

Drop leftover trust center page_title columns - #1596

Draft
gearnode wants to merge 1 commit into
mainfrom
cursor/fix-trust-centers-page-title-null-b2d2
Draft

Drop leftover trust center page_title columns#1596
gearnode wants to merge 1 commit into
mainfrom
cursor/fix-trust-centers-page-title-null-b2d2

Conversation

@gearnode

@gearnode gearnode commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Organization create fails when trust_centers still has the obsolete NOT NULL page_title (or title) column:

cannot insert organization: cannot insert compliance portal: …
ERROR: null value in column "page_title" … (SQLSTATE 23502)

Inserts only populate entity_name. Branding briefly lived as page_titletitleentity_name; installs that skipped the rename can keep the old NOT NULL column beside entity_name, so new portal rows violate the constraint.

Changes

  • Make the page_titletitle rename idempotent
  • Make the title backfill accept either title or page_title
  • Drop both obsolete columns when introducing entity_name
  • Add a repair migration that ensures entity_name exists and drops leftover page_title/title

Test plan

  • Applied full migration chain on a fresh DB → only entity_name remains
  • Simulated stuck schema (page_title + entity_name) → repair drops page_title; insert with entity_name succeeds
  • Simulated page_title-only schema → repair adds entity_name from page_title and drops the old column
  • Simulated skipped rename, then continued migrations → hardened chain reaches entity_name-only schema
Open in Web Open in Cursor 

Summary by cubic

Fixes org creation failures by removing leftover NOT NULL page_title/title columns in trust_centers and making migrations idempotent. Ensures only entity_name is used going forward.

Coredata +142 -12

  • Make page_titletitle rename idempotent.
  • Backfill uses title or page_title if present.
  • When adding entity_name, drop title and page_title with IF EXISTS.
  • Add repair migration to create/backfill entity_name from organizations.name, page_title, or title, then drop obsolete columns.

Written for commit c94de82. Summary will update on new commits.

Review in cubic

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>
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