mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 22:07:10 +00:00
Tweak DB migration to schema version 21 (#56767)
This commit is contained in:
parent
be34a2ddea
commit
52e9f76f94
@ -522,9 +522,11 @@ def _apply_update(instance, session, new_version, old_version): # noqa: C901
|
|||||||
)
|
)
|
||||||
with contextlib.suppress(SQLAlchemyError):
|
with contextlib.suppress(SQLAlchemyError):
|
||||||
connection.execute(
|
connection.execute(
|
||||||
|
# Using LOCK=EXCLUSIVE to prevent the database from corrupting
|
||||||
|
# https://github.com/home-assistant/core/issues/56104
|
||||||
text(
|
text(
|
||||||
f"ALTER TABLE {table} CONVERT TO "
|
f"ALTER TABLE {table} CONVERT TO "
|
||||||
"CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"
|
"CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci LOCK=EXCLUSIVE"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
elif new_version == 22:
|
elif new_version == 22:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user