mirror of
https://github.com/smittix/intercept.git
synced 2026-04-24 06:40:00 -07:00
Persist Meteor decode job state
This commit is contained in:
@@ -717,6 +717,25 @@ def init_db() -> None:
|
||||
FOREIGN KEY (observation_id) REFERENCES ground_station_observations(id) ON DELETE CASCADE
|
||||
)
|
||||
''')
|
||||
|
||||
conn.execute('''
|
||||
CREATE TABLE IF NOT EXISTS ground_station_decode_jobs (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
observation_id INTEGER,
|
||||
norad_id INTEGER,
|
||||
backend TEXT NOT NULL,
|
||||
status TEXT NOT NULL DEFAULT 'queued',
|
||||
input_path TEXT,
|
||||
output_dir TEXT,
|
||||
error_message TEXT,
|
||||
details_json TEXT,
|
||||
started_at TIMESTAMP,
|
||||
completed_at TIMESTAMP,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (observation_id) REFERENCES ground_station_observations(id) ON DELETE CASCADE
|
||||
)
|
||||
''')
|
||||
|
||||
conn.execute('''
|
||||
CREATE INDEX IF NOT EXISTS idx_gs_observations_norad
|
||||
@@ -733,6 +752,11 @@ def init_db() -> None:
|
||||
ON ground_station_outputs(observation_id, created_at)
|
||||
''')
|
||||
|
||||
conn.execute('''
|
||||
CREATE INDEX IF NOT EXISTS idx_gs_decode_jobs_observation
|
||||
ON ground_station_decode_jobs(observation_id, created_at)
|
||||
''')
|
||||
|
||||
# Lightweight schema migrations for existing installs.
|
||||
profile_cols = {
|
||||
row['name'] for row in conn.execute('PRAGMA table_info(observation_profiles)')
|
||||
|
||||
Reference in New Issue
Block a user