Skip to content

0045. Squashed Initial Schema And Namespaced Packages

Status

Accepted and implemented in 2.1.0. Supersedes the 0001–0017 revision history and the cli/command_center exclusion in ADR 0044. Resolves MainSequenceMarkets#12, #14 and #15. Amends ADRs 0034, 0037, 0042 and 0043, and withdraws the 2.0.2 CHANGELOG promise that revisions 0001–0017 stay unchanged.

The legacy upgrade policy below is superseded by ADR 0046 in 2.2.7: Production was found with a populated 0017 schema, which must be preserved.

Context

No MetaTables runtime holds an applied ms-markets history; 0001–0017 only ran on the retired shared backend (#12). That history altered tables repeatedly, and 0010 ran PostgreSQL-only SQL, so it could not build the schema on the MetaTables local SQLite runtime (#15). The wheel also still installed top-level cli, command_center and .agents entries (#14).

Decision

  • One revision, 0018_initial_schema, generated from the models, creates the whole schema on PostgreSQL and on the local SQLite runtime. It never reuses an earlier revision ID: under a reused 0001, a database at the old 0001 would pass as already at head and skip every table. MetaTables 0.1.12 runs JSONB as JSON, Numeric as SQLite numbers and postgresql_where predicates there. The provider key msm:<namespace>, MarketsAlembicVersion and its table are unchanged.
  • cli is renamed msm_cli and command_center is renamed msm_command_center, siblings of msm_migrations. The msm console script is unchanged. Bundled skills ship inside msm_cli/_skills/ms_markets. The wheel installs only msm, msm_cli, msm_command_center, msm_migrations, msm_portfolios and msm_pricing.

Consequences

  • The original release rejected 0001–0017. Production later proved the assumption above false: its populated database remained at 0017. Release 2.2.7 provides the forward bridge in ADR 0046. Do not reset that database or stamp its version. Earlier legacy heads require separate analysis.
  • Imports of cli and command_center change to msm_cli and msm_command_center.
  • Later schema changes are new revisions after 0018. MetaTables generates them as batch blocks, which run on both engines.