Public Member Functions | |
| DataMigrationStatus | migrate_data_impl (self, Recorder instance) |
| DataMigrationStatus | needs_migrate_impl (self, Recorder instance, Session session) |
Public Member Functions inherited from homeassistant.components.recorder.migration.BaseRunTimeMigration | |
| bool | migrate_data (self, Recorder instance) |
| None | queue_migration (self, Recorder instance, Session session) |
Public Member Functions inherited from homeassistant.components.recorder.migration.BaseMigration | |
| None | __init__ (self, int schema_version, dict[str, int] migration_changes) |
| None | migration_done (self, Recorder instance, Session session) |
| bool | needs_migrate (self, Recorder instance, Session session) |
Static Public Attributes | |
| string | migration_id = "event_id_post_migration" |
| int | migration_version = 2 |
| task = MigrationTask | |
Static Public Attributes inherited from homeassistant.components.recorder.migration.BaseRunTimeMigration | |
| task = MigrationTask | |
Static Public Attributes inherited from homeassistant.components.recorder.migration.BaseMigration | |
| int | migration_version = 1 |
| None | |
| int | required_schema_version = 0 |
Static Private Member Functions | |
| bool | _legacy_event_id_foreign_key_exists (Recorder instance) |
Additional Inherited Members | |
Public Attributes inherited from homeassistant.components.recorder.migration.BaseMigration | |
| migration_changes | |
| schema_version | |
Migration to remove old event_id index from states.
Definition at line 2662 of file migration.py.
|
staticprivate |
Check if the legacy event_id foreign key exists.
Definition at line 2714 of file migration.py.
| DataMigrationStatus homeassistant.components.recorder.migration.EventIDPostMigration.migrate_data_impl | ( | self, | |
| Recorder | instance | ||
| ) |
Remove old event_id index from states, returns True if completed. We used to link states to events using the event_id column but we no longer store state changed events in the events table. If all old states have been purged and existing states are in the new format we can drop the index since it can take up ~10MB per 1M rows.
Reimplemented from homeassistant.components.recorder.migration.BaseMigration.
Definition at line 2669 of file migration.py.
| DataMigrationStatus homeassistant.components.recorder.migration.EventIDPostMigration.needs_migrate_impl | ( | self, | |
| Recorder | instance, | ||
| Session | session | ||
| ) |
Return if the migration needs to run.
Reimplemented from homeassistant.components.recorder.migration.BaseMigration.
Definition at line 2730 of file migration.py.
|
static |
Definition at line 2665 of file migration.py.
|
static |
Definition at line 2667 of file migration.py.
|
static |
Definition at line 2666 of file migration.py.