fix: initialise new terraform state to avoid NOT NULL constraint violation
This commit is contained in:
parent
0b3254f99c
commit
b91e078e22
1 changed files with 1 additions and 1 deletions
|
@ -42,7 +42,7 @@ def handle_update(key: str) -> ResponseReturnValue:
|
||||||
def handle_lock(key: str) -> ResponseReturnValue:
|
def handle_lock(key: str) -> ResponseReturnValue:
|
||||||
state = TerraformState.query.filter(TerraformState.key == key).with_for_update().first()
|
state = TerraformState.query.filter(TerraformState.key == key).with_for_update().first()
|
||||||
if state is None:
|
if state is None:
|
||||||
state = TerraformState(key=key)
|
state = TerraformState(key=key, state="")
|
||||||
db.session.add(state)
|
db.session.add(state)
|
||||||
if state.lock is not None:
|
if state.lock is not None:
|
||||||
lock = state.lock
|
lock = state.lock
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue