67a9a15775
- 新增 app_config 表 + model/repository/config_schema + admin config 路由与 schema + 测试 - rewards.py 及 ad_reward/signin/task/wallet/comparison_milestone repositories 接入可配置项;ad.py / admin/main.py 配套 - alembic merge(ebb6af5c0b56)合并本地 app_config(cfg1a2b3c4d5)与 incoming price_report/best_deeplink(b7e2c1a9f4d3)两 head Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Reviewed-on: #14
34 lines
1.0 KiB
Python
34 lines
1.0 KiB
Python
"""app_config table (运营可配置项:rewards 常量等后台化)
|
|
|
|
Revision ID: cfg1a2b3c4d5
|
|
Revises: ad60a1b2c3d4
|
|
Create Date: 2026-06-04 12:00:00.000000
|
|
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = 'cfg1a2b3c4d5'
|
|
down_revision: Union[str, Sequence[str], None] = 'ad60a1b2c3d4'
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.create_table(
|
|
'app_config',
|
|
sa.Column('key', sa.String(length=64), nullable=False),
|
|
sa.Column('value', sa.JSON().with_variant(sa.dialects.postgresql.JSONB(), 'postgresql'), nullable=False),
|
|
sa.Column('updated_by_admin_id', sa.Integer(), nullable=True),
|
|
sa.Column('updated_at', sa.DateTime(timezone=True), server_default=sa.text('(CURRENT_TIMESTAMP)'), nullable=False),
|
|
sa.PrimaryKeyConstraint('key'),
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_table('app_config')
|