Retain submission time and instructions for live and terminal orders

This commit is contained in:
2026-12-03 14:30:12 +08:00
parent 3bec895a0a
commit 2a6332620c
8 changed files with 133 additions and 4 deletions
+7
View File
@@ -84,6 +84,13 @@ impl Exchange {
db.busy_timeout(Duration::from_secs(10))?;
db.execute_batch("PRAGMA foreign_keys=ON")?;
db.execute_batch(include_str!("schema.sql"))?;
let submissions_ready: bool = db.query_row(
"SELECT EXISTS(SELECT 1 FROM sqlite_schema WHERE type='table' AND name='order_submissions')",
[], |r| r.get(0),
)?;
if !submissions_ready {
db.execute_batch(include_str!("order_submission_schema.sql"))?;
}
let directory_ready: bool = db.query_row(
"SELECT EXISTS(SELECT 1 FROM sqlite_schema WHERE type='table' AND name='event_directory_ids')",
[], |row| row.get(0),