Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.recorder.migration.EntityIDMigration Class Reference
Inheritance diagram for homeassistant.components.recorder.migration.EntityIDMigration:
[legend]
Collaboration diagram for homeassistant.components.recorder.migration.EntityIDMigration:
[legend]

Public Member Functions

DataMigrationStatus migrate_data_impl (self, Recorder instance)
 
None migration_done (self, Recorder instance, Session session)
 
StatementLambdaElement needs_migrate_query (self)
 
- Public Member Functions inherited from homeassistant.components.recorder.migration.BaseMigrationWithQuery
DataMigrationStatus needs_migrate_impl (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)
 
bool needs_migrate (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)
 

Static Public Attributes

string migration_id = "entity_id_migration"
 
 required_schema_version = STATES_META_SCHEMA_VERSION
 
 task = CommitBeforeMigrationTask
 
- Static Public Attributes inherited from homeassistant.components.recorder.migration.BaseMigration
int migration_version = 1
 
 None
 
int required_schema_version = 0
 
- Static Public Attributes inherited from homeassistant.components.recorder.migration.BaseRunTimeMigration
 task = MigrationTask
 

Additional Inherited Members

- Public Attributes inherited from homeassistant.components.recorder.migration.BaseMigration
 migration_changes
 
 schema_version
 

Detailed Description

Migration to migrate entity_ids to states_meta.

Definition at line 2567 of file migration.py.

Member Function Documentation

◆ migrate_data_impl()

DataMigrationStatus homeassistant.components.recorder.migration.EntityIDMigration.migrate_data_impl (   self,
Recorder  instance 
)
Migrate entity_ids to states_meta, return True if completed.

We do this in two steps because we need the history queries to work
while we are migrating.

1. Link the states to the states_meta table
2. Remove the entity_id column from the states table (in post_migrate_entity_ids)

Reimplemented from homeassistant.components.recorder.migration.BaseMigration.

Definition at line 2577 of file migration.py.

◆ migration_done()

None homeassistant.components.recorder.migration.EntityIDMigration.migration_done (   self,
Recorder  instance,
Session  session 
)
Will be called after migrate returns True.

Reimplemented from homeassistant.components.recorder.migration.BaseMigration.

Definition at line 2645 of file migration.py.

◆ needs_migrate_query()

StatementLambdaElement homeassistant.components.recorder.migration.EntityIDMigration.needs_migrate_query (   self)
Check if the data is migrated.

Reimplemented from homeassistant.components.recorder.migration.BaseMigrationWithQuery.

Definition at line 2657 of file migration.py.

Member Data Documentation

◆ migration_id

string homeassistant.components.recorder.migration.EntityIDMigration.migration_id = "entity_id_migration"
static

Definition at line 2571 of file migration.py.

◆ required_schema_version

homeassistant.components.recorder.migration.EntityIDMigration.required_schema_version = STATES_META_SCHEMA_VERSION
static

Definition at line 2570 of file migration.py.

◆ task

homeassistant.components.recorder.migration.EntityIDMigration.task = CommitBeforeMigrationTask
static

Definition at line 2572 of file migration.py.


The documentation for this class was generated from the following file: