Merge remote-tracking branch 'origin/main' into sprint-38/server
# Conflicts: # CHANGELOG.md # server/data/systems.db # tooling/check-systems-db-stamp # tooling/economy-db/import_economics.py # tooling/planet-gen/generate_atlas.py
This commit is contained in:
@@ -35,6 +35,10 @@ from pathlib import Path
|
||||
|
||||
REPO_ROOT = Path(__file__).resolve().parent.parent.parent
|
||||
|
||||
# Import shared schema version constant (#888) — single source of truth in tooling/schema_version.py
|
||||
sys.path.insert(0, str(REPO_ROOT / "tooling"))
|
||||
from schema_version import SCHEMA_VERSION # noqa: E402
|
||||
|
||||
DB_PATH = REPO_ROOT / "server" / "data" / "systems.db"
|
||||
STAR_MAP = REPO_ROOT / "docs" / "design" / "star-map.json"
|
||||
COMMODITIES_TOML = REPO_ROOT / "wiki" / "economics" / "commodities.toml"
|
||||
@@ -78,6 +82,7 @@ IMPORT_ECONOMICS_SOURCES: tuple[Path, ...] = (
|
||||
GENERATE_BRANDS_RS,
|
||||
GENERATE_BRANDS_NAMES_RS,
|
||||
GENERATE_BRANDS_WRAPPER,
|
||||
REPO_ROOT / "tooling" / "schema_version.py",
|
||||
)
|
||||
|
||||
|
||||
@@ -99,9 +104,10 @@ def _write_stamp(conn: sqlite3.Connection, generator_name: str, *source_files: P
|
||||
schema_sha = _file_sha1(SCHEMA_SQL)
|
||||
generator_sha = _file_sha1(*source_files)
|
||||
conn.execute(
|
||||
"""INSERT OR REPLACE INTO meta (generator_name, schema_version, generator_sha, generated_at)
|
||||
VALUES (?, ?, ?, datetime('now'))""",
|
||||
(generator_name, schema_sha, generator_sha),
|
||||
"""INSERT OR REPLACE INTO meta
|
||||
(generator_name, schema_version, schema_sha, generator_sha, generated_at)
|
||||
VALUES (?, ?, ?, ?, datetime('now'))""",
|
||||
(generator_name, SCHEMA_VERSION, schema_sha, generator_sha),
|
||||
)
|
||||
|
||||
|
||||
@@ -350,6 +356,7 @@ COLUMN_MIGRATIONS = [
|
||||
("corporations", "shadow_economy_access", "INTEGER DEFAULT 0"),
|
||||
("brand_products", "price_tier", "TEXT"),
|
||||
("bodies", "body_radius_km", "REAL"), # D-204 — physical radius in km, nullable
|
||||
("meta", "schema_sha", "TEXT"),
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user