From cddaec573036a659a4568c753d3672a04e0c9dee Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 6 Oct 2026 22:42:39 +0100 Subject: [PATCH] Schema 1.4.0: drop meta.sessions.json The definition string is the only stored schedule. The "json" column held a parsed copy that the Python client wrote, the C++ client never wrote, and neither client read -- and a raw UPDATE of one field silently left two different schedules. Clients derive the parsed form from the definition. 09_schema_check.sql no longer expects the column; VERSION and 10_schema_version.sql at 1.4.0. Re-provision databases (no migrations). Co-Authored-By: Claude Opus 5.5 --- VERSION | 2 +- sql/03_tables.sql | 5 ++++- sql/09_schema_check.sql | 1 - sql/10_schema_version.sql | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index f0bb29e..88c5fb8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3.0 +1.4.0 diff --git a/sql/03_tables.sql b/sql/03_tables.sql index cc009ed..2346b43 100644 --- a/sql/03_tables.sql +++ b/sql/03_tables.sql @@ -128,10 +128,13 @@ CREATE TABLE meta.series ( needs_reindex boolean NOT NULL DEFAULT false ); +-- A session's schedule is its definition string, nothing else. (Until 1.4.0 +-- a parsed copy was also stored in a "json" column; nothing read it, the C++ +-- client never wrote it, and it could silently disagree with the definition. +-- Clients derive the parsed form from the definition when they need it.) CREATE TABLE meta.sessions ( name character varying(50) NOT NULL, definition text NOT NULL, - "json" text, exchange_id character varying(12) NOT NULL ); diff --git a/sql/09_schema_check.sql b/sql/09_schema_check.sql index 73ec36c..c55b6f6 100644 --- a/sql/09_schema_check.sql +++ b/sql/09_schema_check.sql @@ -170,7 +170,6 @@ BEGIN ('meta.series', 'needs_reindex', 'boolean', true), ('meta.sessions', 'name', 'character varying(50)', true), ('meta.sessions', 'definition', 'text', true), - ('meta.sessions', 'json', 'text', false), ('meta.sessions', 'exchange_id', 'character varying(12)', true), ('meta.timezones', 'iana_name', 'character varying(50)', true), ('meta.timezones', 'display_name', 'character varying(100)', true), diff --git a/sql/10_schema_version.sql b/sql/10_schema_version.sql index 7fee6e6..9e94f1e 100644 --- a/sql/10_schema_version.sql +++ b/sql/10_schema_version.sql @@ -5,4 +5,4 @@ -- they were built for (Python: DB_SCHEMA_VERSION in tsapi_pgdb/_version.py). INSERT INTO meta.schema_version (version, description) -VALUES ('1.3.0', 'meta.find_series_registry_mismatches()'); +VALUES ('1.4.0', 'meta.sessions.json dropped: the definition is the only schedule');