[Task] Decide: Which table names must remain stable for painless migrations? #55

Closed
opened 2026-07-06 11:34:38 +02:00 by zemion · 2 comments
Owner

Imported from the GovOPlaN access extraction plan open decisions.

  • Source: /mnt/DATA/git/govoplan-core/docs/ACCESS_EXTRACTION_PLAN.md
  • Line: 356
  • Section: Open Decisions
  • Source status: decision needed

Imported backlog item:

- [ ] Which table names must remain stable for painless migrations?
<!-- codex-backlog-fingerprint:b79321c1ea721a21c3cdf68c --> Imported from the GovOPlaN access extraction plan open decisions. - Source: `/mnt/DATA/git/govoplan-core/docs/ACCESS_EXTRACTION_PLAN.md` - Line: `356` - Section: `Open Decisions` - Source status: `decision needed` Imported backlog item: ```markdown - [ ] Which table names must remain stable for painless migrations? ```
zemion added this to the Access Extraction milestone 2026-07-06 12:48:57 +02:00
zemion added the
status
needs-info
label 2026-07-08 03:00:06 +02:00
Author
Owner

Codex State: recommendation 2026-07-09

Recommendation: keep the historical live table names stable as the migration contract, and close this once accepted.

Suggested decision:

  • Preserve existing persisted table names for painless upgrades: accounts, users, groups, roles, api_keys, auth_sessions, tenants, system_settings, governance_templates, governance_template_assignments, audit_log, mail_server_profiles, file_connector_profiles, and file_connector_credentials.
  • Do not rename migrated tables to module-prefixed alternatives such as access_users unless an explicit data migration and compatibility window is approved.
  • New module-owned tables should use clear module-owned names from the start.
  • Module ownership may move, but table names are part of the persistence ABI.

Effects: this keeps #43 closed, constrains #62/#63 cleanup to code ownership rather than table renames, and keeps #82 focused on tenant lifecycle/switching/deletion rather than tenant table renaming.

## Codex State: recommendation 2026-07-09 Recommendation: keep the historical live table names stable as the migration contract, and close this once accepted. Suggested decision: - Preserve existing persisted table names for painless upgrades: accounts, users, groups, roles, api_keys, auth_sessions, tenants, system_settings, governance_templates, governance_template_assignments, audit_log, mail_server_profiles, file_connector_profiles, and file_connector_credentials. - Do not rename migrated tables to module-prefixed alternatives such as access_users unless an explicit data migration and compatibility window is approved. - New module-owned tables should use clear module-owned names from the start. - Module ownership may move, but table names are part of the persistence ABI. Effects: this keeps #43 closed, constrains #62/#63 cleanup to code ownership rather than table renames, and keeps #82 focused on tenant lifecycle/switching/deletion rather than tenant table renaming.
Author
Owner

Implemented the early-development table namespace cleanup.

Summary:

  • Renamed core/access/tenancy/admin-owned platform tables to module-scoped names such as access_users, access_groups, access_roles, access_api_keys, tenancy_tenants, core_system_settings, and admin_governance_templates.
  • Updated ORM models, foreign keys, indexes, live module migrations, reconciliation checks, and tests to use the new names.
  • Added compatibility migration 2e3f4a5b6c7d_namespace_platform_tables.py to rename existing early-dev databases, while fresh databases create the names directly.
  • Kept already module-scoped tables such as mail_, file_, calendar_, campaign, and audit_log unchanged.

Verification passed:

  • python -m unittest tests.test_database_migrations
  • python -m unittest tests.test_module_system tests.test_access_contracts
  • python -m compileall over core/access/tenancy/admin/audit/mail/files/campaign/calendar packages
  • scripts/check_dependency_boundaries.py
  • npm run test:module-permutations

Closing this because the decision has been made and the rename is implemented.

Implemented the early-development table namespace cleanup. Summary: - Renamed core/access/tenancy/admin-owned platform tables to module-scoped names such as access_users, access_groups, access_roles, access_api_keys, tenancy_tenants, core_system_settings, and admin_governance_templates. - Updated ORM models, foreign keys, indexes, live module migrations, reconciliation checks, and tests to use the new names. - Added compatibility migration 2e3f4a5b6c7d_namespace_platform_tables.py to rename existing early-dev databases, while fresh databases create the names directly. - Kept already module-scoped tables such as mail_*, file_*, calendar_*, campaign*, and audit_log unchanged. Verification passed: - python -m unittest tests.test_database_migrations - python -m unittest tests.test_module_system tests.test_access_contracts - python -m compileall over core/access/tenancy/admin/audit/mail/files/campaign/calendar packages - scripts/check_dependency_boundaries.py - npm run test:module-permutations Closing this because the decision has been made and the rename is implemented.
zemion removed the
codex/needs-human
status
needs-info
labels 2026-07-09 11:00:58 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: add-ideas/govoplan-core#55
No description provided.