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 UserInputs(BaseModel):
id = AutoField()
app = ForeignKeyField(App)
app = ForeignKeyField(App, on_delete='CASCADE')
hash_id = CharField(null=False)
query = TextField(null=True)
user_input = TextField(null=True)
previous_user_input = ForeignKeyField('self', null=True, column_name='previous_user_input')
previous_step = ForeignKeyField('self', null=True, column_name='previous_step')
class Meta:
db_table = 'user_inputs'