diff --git a/.claude/rules/asset-pipeline.md b/.claude/rules/asset-pipeline.md index 280bd1ffc..91b2ee6e6 100644 --- a/.claude/rules/asset-pipeline.md +++ b/.claude/rules/asset-pipeline.md @@ -52,7 +52,7 @@ CREATE TABLE meta ( ``` `schema_version` is a **monotonic semver string** (e.g. `"1.0.0"`), not a hash. -It is defined as the `SCHEMA_VERSION` constant in `tooling/economy-db/import_economics.py` +It is defined as the `SCHEMA_VERSION` constant in `tooling/schema_version.py` and must be bumped manually whenever the schema changes in a backwards-incompatible way. Unlike a SHA-1 hash, semver strings are orderable — this enables savegame migration lineage in Phase 5+: a save file can record which schema version it derives from and @@ -183,6 +183,6 @@ loader can determine which migrations to apply by comparing that version to the current one. `meta.schema_sha` retains the old SHA-1 for tamper detection. **When to bump `SCHEMA_VERSION`:** edit the `SCHEMA_VERSION = "1.0.0"` constant in -`tooling/economy-db/import_economics.py` whenever a schema change is backwards-incompatible +`tooling/schema_version.py` whenever a schema change is backwards-incompatible (column removed, type changed, FK constraint added, table dropped). Additive changes (new nullable columns, new tables, new indexes) do not require a bump. diff --git a/server/data/systems-schema.sql b/server/data/systems-schema.sql index 2c2e9c9b4..cb2a9b966 100644 --- a/server/data/systems-schema.sql +++ b/server/data/systems-schema.sql @@ -485,7 +485,7 @@ CREATE INDEX IF NOT EXISTS idx_gate_links_to ON gate_links(to_system_id); -- One row per generator, updated on each successful non-dry-run. -- schema_version: monotonic semver string (e.g. "1.0.0") — bump on backwards-incompatible changes. -- Orderable, enabling savegame migration lineage (Phase 5+). --- Defined as SCHEMA_VERSION constant in tooling/economy-db/import_economics.py. +-- Defined as SCHEMA_VERSION constant in tooling/schema_version.py. -- schema_sha: SHA-1 hex of systems-schema.sql content at generation time (tamper detection). -- generator_sha: SHA-1 hex of the generator source file(s) content -- generated_at: ISO-8601 UTC timestamp of the run diff --git a/server/data/systems.db b/server/data/systems.db index d57fd208b..cc02da9a9 100644 Binary files a/server/data/systems.db and b/server/data/systems.db differ