Skip to content

Drop the reverted inbound registration schema during upgrade. - #399

Merged
csev merged 1 commit into
masterfrom
drop-reverted-registration
Nov 22, 2026
Merged

csev merged 1 commit into
masterfrom
drop-reverted-registration

Conversation

@csev

@csev csev commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • During upgrade, drop the leftover inbound registration schema from the November 2026 detour: the lti_registration table, its foreign key from lti_key, and the five columns added to lti_key.
  • A missing table, column, foreign key, or index is left alone and not reported.
  • The block is marked at both ends so it can be deleted once every site has upgraded past it. It does not touch lti_tool_registration or lti_tool_deployment.

Test plan

  • On a database that still has the table and columns, run php admin/upgrade.php and confirm the DROP lines appear once.
  • Run upgrade again and confirm those objects are not mentioned.
  • On a database that never had them, confirm upgrade stays silent about them.

Made with Cursor

Summary by CodeRabbit

  • Bug Fixes
    • Improved database upgrade handling when remnants of an earlier LTI registration setup are present. Upgrades now clean up obsolete schema elements when available and continue if cleanup encounters an error.
    • Existing registration records are noted during cleanup before the obsolete data is removed.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Explain Change →

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

Parsing warnings: 1

Validation error: Unrecognized key: "config_file" at "reviews.tools.phpstan"
Configuration instructions

  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

No actionable comments were generated in the recent review.

Walkthrough

The database upgrade removes leftover inbound registration schema objects. It checks for matching foreign keys, columns, indexes, and the lti_registration table. It logs positive row counts and reports schema-drop failures as non-fatal.

Changes: Registration schema cleanup

Layer / File(s) Summary
Remove legacy registration schema
lib/src/Services/Lti/database.php
The upgrade drops matching foreign keys and existing legacy columns. It drops the named index only when it is not a foreign-key constraint. If lti_registration exists, the upgrade counts its rows, logs a notice when the count is positive, and drops the table. Cleanup SQL failures are logged and reported as non-fatal.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

Merge Risk: Minimal · up to 177c8

This upgrade step removes leftover schema from the reverted inbound registration feature and skips anything already missing. No concrete merge-blocking risk was identified. Running an upgrade against a database that has the old schema, and one that never had it, would still be a sensible check.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title states the main change: the upgrade drops the reverted inbound lti_registration schema. The raw summary confirms the upgrade removes the lti_registration table, its foreign keys on lti_key, …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title states the main change: the upgrade drops the reverted inbound lti_registration schema. The raw summary confirms the upgrade removes the lti_registration table, its foreign keys on lti_key, and five leftover columns. The title is specific, short, and matches the PR objectives.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 65fdd40 and 177c8b3.

Files selected for processing: 1

  • lib/src/Services/Lti/database.php

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@csev
csev merged commit c7727a8 into master Nov 22, 2026
12 checks passed
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