feat: add SQL query tool, platform debug, loyalty settings, and multi-module improvements
Some checks failed
Some checks failed
- Add admin SQL query tool with saved queries, schema explorer presets, and collapsible category sections (dev_tools module) - Add platform debug tool for admin diagnostics - Add loyalty settings page with owner-only access control - Fix loyalty settings owner check (use currentUser instead of window.__userData) - Replace HTTPException with AuthorizationException in loyalty routes - Expand loyalty module with PIN service, Apple Wallet, program management - Improve store login with platform detection and multi-platform support - Update billing feature gates and subscription services - Add store platform sync improvements and remove is_primary column - Add unit tests for loyalty (PIN, points, stamps, program services) - Update i18n translations across dev_tools locales Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
35
alembic/versions/remove_store_platform_is_primary.py
Normal file
35
alembic/versions/remove_store_platform_is_primary.py
Normal file
@@ -0,0 +1,35 @@
|
||||
"""Remove is_primary from store_platforms
|
||||
|
||||
The platform is always deterministic from the URL context (path in dev,
|
||||
subdomain/domain in prod) and the JWT carries token_platform_id.
|
||||
The is_primary column was a fallback picker that silently returned the
|
||||
wrong platform for multi-platform stores.
|
||||
|
||||
Revision ID: remove_is_primary_001
|
||||
Revises: billing_001
|
||||
Create Date: 2026-03-09
|
||||
"""
|
||||
|
||||
import sqlalchemy as sa
|
||||
|
||||
from alembic import op
|
||||
|
||||
revision = "remove_is_primary_001"
|
||||
down_revision = "billing_001"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.drop_index("idx_store_platform_primary", table_name="store_platforms")
|
||||
op.drop_column("store_platforms", "is_primary")
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.add_column(
|
||||
"store_platforms",
|
||||
sa.Column("is_primary", sa.Boolean(), nullable=False, server_default="false"),
|
||||
)
|
||||
op.create_index(
|
||||
"idx_store_platform_primary", "store_platforms", ["store_id", "is_primary"]
|
||||
)
|
||||
Reference in New Issue
Block a user