mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +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:
|
||||
index.create(engine)
|
||||
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
|
||||
|
||||
_LOGGER.warning(
|
||||
|
Loading…
x
Reference in New Issue
Block a user