Skip to content

Drop the exact-byte columns and unique key_key when no value repeats. - #402

Open
csev wants to merge 3 commits into
masterfrom
drop-exact-byte-columns
Open

csev wants to merge 3 commits into
masterfrom
drop-exact-byte-columns

Conversation

@csev

@csev csev commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Drop the seven stored exact-byte columns and every index that uses them. Fresh installs no longer create them, and upgrade drops an existing index before the column.
  • Add UNIQUE(key_key) only after a scan finds no repeated consumer key. A NULL key_key stays repeatable, and a duplicate group leaves the index off for the next run.
  • The ascii_bin identity columns and the sha256 uniques stay.

Test plan

  • Run php admin/upgrade.php on a database that still has the exact-byte columns and confirm all seven indexes and columns drop.
  • Run it again and confirm each exact-byte column is already absent and key_key reports its unique already present.
  • Confirm the sha256 uniques are still present.
  • On a database with two identical non-NULL key_key values, confirm the upgrade logs the duplicate and does not add lti_key_const_key_key.

Made with Cursor

Summary by CodeRabbit

  • Database Updates
    • Upgrade routines check existing values before applying certain uniqueness rules. If duplicates are found, the affected rule is left unapplied for a later upgrade attempt.
    • Generated exact-byte columns and their associated uniqueness constraints have been removed for several LTI and profile keys. A uniqueness rule for LTI key values is applied only when the values meet the required format and contain no duplicates.
    • Upgrade checks now report identity values with trailing spaces; secrets are redacted in these reports.
    • Legacy inbound-registration database structures are removed during upgrades.

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

1 participant