-
-
Notifications
You must be signed in to change notification settings - Fork 36.6k
Fix minimum schema version to run event_id_post_migration #139014
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
Conversation
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
|
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
bdraco
commented
Feb 21, 2025
The table rebuild to fix the foreign key constraint was added in #120779 but the schema version was not bumped so we need to make sure any database that was created with schema 43 or older still has the migration run as otherwise they will not be able to purge the database with SQLite since each delete in the events table will due a full table scan of the states table to look for a foreign key that is not there fixes #138818
f7de2c1 to
00c0e07
Compare
bdraco
commented
Feb 21, 2025
bdraco
commented
Feb 21, 2025
bdraco
commented
Feb 21, 2025
bdraco
commented
Feb 21, 2025
bdraco
commented
Feb 21, 2025
bdraco
commented
Feb 21, 2025
bdraco
commented
Feb 21, 2025
bdraco
commented
Feb 21, 2025
bdraco
commented
Feb 21, 2025
bdraco
commented
Feb 21, 2025
bdraco
commented
Feb 21, 2025
bdraco
commented
Feb 21, 2025
bdraco
commented
Feb 21, 2025
bdraco
commented
Feb 21, 2025
Member
Author
|
Got distracted with esphome/esphome#8297 need to finish fixing the tests |
bdraco
commented
Feb 22, 2025
tests/components/recorder/test_migration_run_time_migrations_remember.py
Outdated
Show resolved
Hide resolved
balloob
approved these changes
Feb 22, 2025
Member
Author
|
Thanks |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
bugfix
cla-signed
core
database: sqlite3
integration: recorder
Quality Scale: internal
small-pr
PRs with less than 30 lines.
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.
Proposed change
The table rebuild to fix the foreign key constraint was added in #120779 but the schema version was not bumped so we need to make sure any database that was created with schema 43 or older still has the migration run as otherwise they will not be able to purge the database with SQLite since each delete in the events table will due a full table scan of the states table to look for a foreign key that is not there
Note that everything works as expected with the migration, but the schema version was set too low so it simply didn't run. The only functional change here is the constant value used to run the migration for databases that were created with schema <= 43 and instead of schema < 28
fixes #138818 fixes #138649 fixes #137651
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: