The old migration chain was broken (downgrade path through vendor->merchant
rename made rollbacks impossible). This squashes everything into fresh
per-module migrations with zero schema drift, verified by autogenerate.
Changes:
- Replace 75 accumulated migrations with 12 per-module initial migrations
(core, billing, catalog, marketplace, cms, customers, orders, inventory,
cart, messaging, loyalty, dev_tools) in a linear chain
- Fix make db-reset to use SQL DROP SCHEMA instead of alembic downgrade base
- Enable migration autodiscovery for all modules (migrations_path in definitions)
- Rewrite alembic/env.py to import all 75 model tables across 13 modules
- Fix AdminNotification import (was incorrectly from tenancy, now from messaging)
- Update squash_migrations.py to handle all module migration directories
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Create loyalty_003 migration: company-based architecture (adds
company_id to all loyalty tables, creates company_loyalty_settings,
renames vendor_id to enrolled_at_vendor_id on cards)
- Move platform migration back to alembic/versions (not loyalty-specific)
- Add version_locations to alembic.ini for module migration discovery
- Add make urls/urls-dev/urls-prod commands (scripts/show_urls.py)
- Fix seed_demo.py: import all module models to resolve SQLAlchemy
string relationships, fix multiple admin query, set platform_id
on vendor content pages
- Fix loyalty test fixtures to match Phase 2 model columns
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>