RoundConfig gets a paused flag toggled via new POST /admin/pause and /admin/resume endpoints (audit-logged, surfaced as a "Manutenzione" card in the admin Parametri view). Pausing only stops the *next* round from opening once the current one closes — rounds/service.py:open_new_round_if_needed still lets an in-progress round finish, draw, and pay out its winner normally. GET /rounds/current exposes lottery_paused so the user page shows a maintenance banner (even while logged out) instead of silently going idle. Also replaces the user dashboard's stacked account-bar card + bento-grid menu with a single sticky navbar (identity row + Deposito/Bet/Prelievo tabs), and moves the page content into a dedicated .app-shell container so the navbar itself can span full width.
38 lines
1.1 KiB
Python
38 lines
1.1 KiB
Python
"""add paused to round_config
|
|
|
|
Revision ID: 5f2079b95b33
|
|
Revises: 1db52f3a7c67
|
|
Create Date: 2026-07-22 00:00:00.000000
|
|
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = '5f2079b95b33'
|
|
down_revision: Union[str, Sequence[str], None] = '1db52f3a7c67'
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
"""Upgrade schema."""
|
|
# server_default backfills the existing singleton row (if any); dropped right
|
|
# after so new rows go through the ORM default instead of a stale constant.
|
|
op.add_column(
|
|
'round_config', sa.Column('paused', sa.Boolean(), nullable=False, server_default=sa.false())
|
|
)
|
|
with op.batch_alter_table('round_config') as batch_op:
|
|
batch_op.alter_column('paused', server_default=None)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
"""Downgrade schema."""
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_column('round_config', 'paused')
|
|
# ### end Alembic commands ###
|