Skip to content

Commit

Permalink
Update migrations.py
Browse files Browse the repository at this point in the history
Added "IF EXISTS" to the DROP CONSTRAINT statement intending to drop the {LTSS.__tablename__}_pkey.
  • Loading branch information
antoonhuiskens authored Jul 13, 2023
1 parent 7a594dd commit cc381d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/ltss/migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def remove_id_column(engine):
con.execute(
text(
f"""ALTER TABLE {LTSS.__tablename__}
DROP CONSTRAINT {LTSS.__tablename__}_pkey CASCADE,
DROP CONSTRAINT IF EXISTS {LTSS.__tablename__}_pkey CASCADE,
ADD PRIMARY KEY(time,entity_id);"""
)
)
Expand Down

0 comments on commit cc381d1

Please sign in to comment.