mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 15:57:06 +00:00
Fix entity_id migration query failing with MySQL 8.0.30 (#90895)
This commit is contained in:
parent
0b3012071e
commit
70d1e733f6
@ -730,7 +730,8 @@ def batch_cleanup_entity_ids() -> StatementLambdaElement:
|
|||||||
lambda: update(States)
|
lambda: update(States)
|
||||||
.where(
|
.where(
|
||||||
States.state_id.in_(
|
States.state_id.in_(
|
||||||
select(States.state_id).join(
|
select(States.state_id)
|
||||||
|
.join(
|
||||||
states_with_entity_ids := select(
|
states_with_entity_ids := select(
|
||||||
States.state_id.label("state_id_with_entity_id")
|
States.state_id.label("state_id_with_entity_id")
|
||||||
)
|
)
|
||||||
@ -739,6 +740,8 @@ def batch_cleanup_entity_ids() -> StatementLambdaElement:
|
|||||||
.subquery(),
|
.subquery(),
|
||||||
States.state_id == states_with_entity_ids.c.state_id_with_entity_id,
|
States.state_id == states_with_entity_ids.c.state_id_with_entity_id,
|
||||||
)
|
)
|
||||||
|
.alias("states_with_entity_ids")
|
||||||
|
.select()
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.values(entity_id=None)
|
.values(entity_id=None)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user