Public Member Functions | |
| None | __init__ (self, int schema_version, dict[str, int] migration_changes) |
| bool | migrate_data (self, Recorder instance) |
| DataMigrationStatus | migrate_data_impl (self, Recorder instance) |
| None | migration_done (self, Recorder instance, Session session) |
| bool | needs_migrate (self, Recorder instance, Session session) |
| DataMigrationStatus | needs_migrate_impl (self, Recorder instance, Session session) |
Public Attributes | |
| migration_changes | |
| schema_version | |
Static Public Attributes | |
| int | migration_version = 1 |
| None | |
| int | required_schema_version = 0 |
Private Member Functions | |
| bool | _migrate_data (self, Recorder instance) |
Base class for migrations.
Definition at line 2276 of file migration.py.
| None homeassistant.components.recorder.migration.BaseMigration.__init__ | ( | self, | |
| int | schema_version, | ||
| dict[str, int] | migration_changes | ||
| ) |
Initialize a new BaseRunTimeMigration.
Definition at line 2284 of file migration.py.
|
private |
Migrate some data, returns True if migration is completed.
Definition at line 2293 of file migration.py.
| bool homeassistant.components.recorder.migration.BaseMigration.migrate_data | ( | self, | |
| Recorder | instance | ||
| ) |
Migrate some data, return True if migration is completed.
Reimplemented in homeassistant.components.recorder.migration.BaseRunTimeMigration, and homeassistant.components.recorder.migration.BaseOffLineMigration.
Definition at line 2290 of file migration.py.
| DataMigrationStatus homeassistant.components.recorder.migration.BaseMigration.migrate_data_impl | ( | self, | |
| Recorder | instance | ||
| ) |
Migrate some data, return if the migration needs to run and if it is done.
Reimplemented in homeassistant.components.recorder.migration.EntityIDPostMigration, homeassistant.components.recorder.migration.EventIDPostMigration, homeassistant.components.recorder.migration.EntityIDMigration, homeassistant.components.recorder.migration.EventTypeIDMigration, homeassistant.components.recorder.migration.EventsContextIDMigration, and homeassistant.components.recorder.migration.StatesContextIDMigration.
Definition at line 2306 of file migration.py.
| None homeassistant.components.recorder.migration.BaseMigration.migration_done | ( | self, | |
| Recorder | instance, | ||
| Session | session | ||
| ) |
Will be called after migrate returns True or if migration is not needed.
Reimplemented in homeassistant.components.recorder.migration.EntityIDMigration, and homeassistant.components.recorder.migration.EventTypeIDMigration.
Definition at line 2309 of file migration.py.
| bool homeassistant.components.recorder.migration.BaseMigration.needs_migrate | ( | self, | |
| Recorder | instance, | ||
| Session | session | ||
| ) |
Return if the migration needs to run. If the migration needs to run, it will return True. If the migration does not need to run, it will return False and mark the migration as done in the database if its not already marked as done.
Definition at line 2318 of file migration.py.
| DataMigrationStatus homeassistant.components.recorder.migration.BaseMigration.needs_migrate_impl | ( | self, | |
| Recorder | instance, | ||
| Session | session | ||
| ) |
Return if the migration needs to run and if it is done.
Reimplemented in homeassistant.components.recorder.migration.EventIDPostMigration, and homeassistant.components.recorder.migration.BaseMigrationWithQuery.
Definition at line 2313 of file migration.py.
| homeassistant.components.recorder.migration.BaseMigration.migration_changes |
Definition at line 2287 of file migration.py.
|
static |
Definition at line 2281 of file migration.py.
|
static |
Definition at line 2279 of file migration.py.
|
static |
Definition at line 2280 of file migration.py.
| homeassistant.components.recorder.migration.BaseMigration.schema_version |
Definition at line 2286 of file migration.py.