Refactored saving previous steps and made steps be loaded by looking at the current step as well

This commit is contained in:
Zvonimir Sabljic
2023-08-10 08:41:46 +02:00
parent 6b7e77b46a
commit 01b50ab3e3
9 changed files with 54 additions and 21 deletions

View File

@@ -6,11 +6,11 @@ from database.models.app import App
class CommandRuns(BaseModel):
id = AutoField()
app = ForeignKeyField(App)
app = ForeignKeyField(App, on_delete='CASCADE')
hash_id = CharField(null=False)
command = TextField(null=True)
cli_response = TextField(null=True)
previous_command_run = ForeignKeyField('self', null=True, column_name='previous_command_run')
previous_step = ForeignKeyField('self', null=True, column_name='previous_step')
class Meta:
db_table = 'command_runs'