mirror of
https://github.com/koloideal/DutyLog.git
synced 2026-08-08 10:01:14 +03:00
fix: media group photos saving, add photos to user notifications, admin info in transaction details, remove deep link fallback
- Fix media group collection: use module-level dicts instead of dialog_data to avoid race conditions between concurrent handler calls - Add photo/media group sending in user notifications (add/remove hours) - Add admin username with emoji to all transaction detail windows - Add emoji prefixes to detail content fields - Support multiple photos via JSON array in photo_file_id column - Change photo_file_id column from String(512) to Text - Add get_photo_file_ids() helper with backward compat for single file_id - Add 'All photos' button for media groups in detail views - Remove /start photo_ deep link fallback handler - Add Alembic migration for column type change
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
"""add_photo_file_id_to_hours_transactions
|
||||
|
||||
Revision ID: a1b2c3d4e5f6
|
||||
Revises: 4fe7f71301e7
|
||||
Create Date: 2026-07-14 23:41:00.000000
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
revision: str = 'a1b2c3d4e5f6'
|
||||
down_revision: Union[str, Sequence[str], None] = '4fe7f71301e7'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.add_column('hours_transactions', sa.Column('photo_file_id', sa.String(length=512), nullable=True))
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_column('hours_transactions', 'photo_file_id')
|
||||
@@ -0,0 +1,37 @@
|
||||
"""change_photo_file_id_to_text
|
||||
|
||||
Revision ID: b2c3d4e5f6g7
|
||||
Revises: a1b2c3d4e5f6
|
||||
Create Date: 2026-07-15 00:35:00.000000
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
revision: str = 'b2c3d4e5f6g7'
|
||||
down_revision: Union[str, Sequence[str], None] = 'a1b2c3d4e5f6'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.alter_column(
|
||||
'hours_transactions',
|
||||
'photo_file_id',
|
||||
existing_type=sa.String(length=512),
|
||||
type_=sa.Text(),
|
||||
existing_nullable=True,
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.alter_column(
|
||||
'hours_transactions',
|
||||
'photo_file_id',
|
||||
existing_type=sa.Text(),
|
||||
type_=sa.String(length=512),
|
||||
existing_nullable=True,
|
||||
)
|
||||
Reference in New Issue
Block a user