mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 18:27:09 +00:00
Handle index already existing on db migration with MySQLdb backend (#37384)
_create_index needed the same check as _add_columns since the MySQLdb backend throws OperationalError instead of InternalError in this case
This commit is contained in:
parent
7da3065de6
commit
ccb77ba1e9
@ -81,7 +81,9 @@ def _create_index(engine, table_name, index_name):
|
|||||||
try:
|
try:
|
||||||
index.create(engine)
|
index.create(engine)
|
||||||
except OperationalError as err:
|
except OperationalError as err:
|
||||||
if "already exists" not in str(err).lower():
|
lower_err_str = str(err).lower()
|
||||||
|
|
||||||
|
if "already exists" not in lower_err_str and "duplicate" not in lower_err_str:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
_LOGGER.warning(
|
_LOGGER.warning(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user