Scenario: Clean DB add minimal comment.

disable_edition_parent_scenario
Pierre-Antoine 2026-05-19 17:54:28 +02:00
parent 42ea50d62e
commit 5ce94a63d3
1 changed files with 4 additions and 0 deletions

View File

@ -228,6 +228,8 @@ class Scenario(SQLSubModel):
for table in tables: for table in tables:
if self.parent is None: if self.parent is None:
# This scenario is the default scenario, so we can
# delete all data marked as deleted
execute( execute(
f"DELETE FROM {table} " + f"DELETE FROM {table} " +
f"WHERE scenario = {self.id} " + f"WHERE scenario = {self.id} " +
@ -235,6 +237,8 @@ class Scenario(SQLSubModel):
) )
continue continue
# Select pamhyr_id for each deleted data in this scenario
# who do not exists into parents scenarios
ids = execute( ids = execute(
f""" f"""
SELECT pamhyr_id FROM {table} SELECT pamhyr_id FROM {table}