--- /dev/null
+-- 2023-03-01 notes
+-- (adding transmitter_status TEXT column)
+-- Rename table observations to observations_v1_102.
+-- Create new observations table with same columns as get-observations.py.
+-- Copy the table, implicitly leaving the new columns as NULL.
+-- Drop the old renamed table.
+-- Vacuum to cleanup.
+-- Runs of get-observations.py will fill in the NULL column.
+
+.echo on
+
+ALTER TABLE observations RENAME TO observations_V1_102;
+
+CREATE TABLE observations
+ (id INTEGER PRIMARY KEY,
+ start TEXT,
+ end TEXT,
+ ground_station INTEGER,
+ transmitter TEXT,
+ norad_cat_id INTEGER,
+ payload TEXT,
+ waterfall TEXT,
+ demoddata TEXT,
+ station_name TEXT,
+ station_lat REAL,
+ station_lng REAL,
+ station_alt REAL,
+ vetted_status TEXT,
+ vetted_user INTEGER,
+ vetted_datetime TEXT,
+ archived INTEGER,
+ archive_url TEXT,
+ client_version TEXT,
+ client_metadata TEXT,
+ status TEXT,
+ waterfall_status TEXT,
+ waterfall_status_user INTEGER,
+ waterfall_status_datetime TEXT,
+ rise_azimuth REAL,
+ set_azimuth REAL,
+ max_altitude REAL,
+ transmitter_uuid TEXT,
+ transmitter_description TEXT,
+ transmitter_type TEXT,
+ transmitter_uplink_low INTEGER,
+ transmitter_uplink_high INTEGER,
+ transmitter_uplink_drift INTEGER,
+ transmitter_downlink_low INTEGER,
+ transmitter_downlink_high INTEGER,
+ transmitter_downlink_drift INTEGER,
+ transmitter_mode TEXT,
+ transmitter_invert INTEGER,
+ transmitter_baud REAL,
+ transmitter_updated TEXT,
+ transmitter_status TEXT,
+ tle0 TEXT,
+ tle1 TEXT,
+ tle2 TEXT,
+ center_frequency INTEGER,
+ observer INTEGER,
+ observation_frequency INTEGER);
+
+INSERT INTO observations(
+ id,
+ start,
+ end,
+ ground_station,
+ transmitter,
+ norad_cat_id,
+ payload,
+ waterfall,
+ demoddata,
+ station_name,
+ station_lat,
+ station_lng,
+ station_alt,
+ vetted_status,
+ vetted_user,
+ vetted_datetime,
+ archived,
+ archive_url,
+ client_version,
+ client_metadata,
+ status,
+ waterfall_status,
+ waterfall_status_user,
+ waterfall_status_datetime,
+ rise_azimuth,
+ set_azimuth,
+ max_altitude,
+ transmitter_uuid,
+ transmitter_description,
+ transmitter_type,
+ transmitter_uplink_low,
+ transmitter_uplink_high,
+ transmitter_uplink_drift,
+ transmitter_downlink_low,
+ transmitter_downlink_high,
+ transmitter_downlink_drift,
+ transmitter_mode,
+ transmitter_invert,
+ transmitter_baud,
+ transmitter_updated,
+ tle0,
+ tle1,
+ tle2)
+SELECT
+ id,
+ start,
+ end,
+ ground_station,
+ transmitter,
+ norad_cat_id,
+ payload,
+ waterfall,
+ demoddata,
+ station_name,
+ station_lat,
+ station_lng,
+ station_alt,
+ vetted_status,
+ vetted_user,
+ vetted_datetime,
+ archived,
+ archive_url,
+ client_version,
+ client_metadata,
+ status,
+ waterfall_status,
+ waterfall_status_user,
+ waterfall_status_datetime,
+ rise_azimuth,
+ set_azimuth,
+ max_altitude,
+ transmitter_uuid,
+ transmitter_description,
+ transmitter_type,
+ transmitter_uplink_low,
+ transmitter_uplink_high,
+ transmitter_uplink_drift,
+ transmitter_downlink_low,
+ transmitter_downlink_high,
+ transmitter_downlink_drift,
+ transmitter_mode,
+ transmitter_invert,
+ transmitter_baud,
+ transmitter_updated,
+ tle0,
+ tle1,
+ tle2
+FROM observations_v1_102;
+
+DROP TABLE observations_v1_102;
+
+VACUUM;
+