Major fixes and new features
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-09-25 15:51:48 +09:00
parent dd7349bb4c
commit ddce9f5125
5586 changed files with 1470941 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
"""add_username_to_users_table
Revision ID: 49846a45b6b0
Revises: 050c22851c2d
Create Date: 2025-09-25 14:11:11.985379
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '49846a45b6b0'
down_revision = '050c22851c2d'
branch_labels = None
depends_on = None
def upgrade() -> None:
# Добавляем колонку username в таблицу users
op.add_column('users', sa.Column('username', sa.String(50), nullable=True, unique=True, index=True))
# Заполняем значения username на основе email (первая часть до @)
op.execute("""
UPDATE users
SET username = split_part(email, '@', 1)
""")
# В будущем можно сделать эту колонку not null, но пока оставим nullable
def downgrade() -> None:
# Удаляем колонку username из таблицы users
op.drop_column('users', 'username')