Удалить alembic/versions/ef38c90eed55_added_last_side_the_conditional_data.py
This commit is contained in:
@@ -1,38 +0,0 @@
|
||||
"""added last side the conditional data
|
||||
|
||||
Revision ID: ef38c90eed55
|
||||
Revises: d3c85bad8c98
|
||||
Create Date: 2025-09-30 08:33:23.415545
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = 'ef38c90eed55'
|
||||
down_revision: Union[str, Sequence[str], None] = 'd3c85bad8c98'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
"""Upgrade schema."""
|
||||
op.add_column('user_conditional_settings', sa.Column('last_side', sa.String(), nullable=True))
|
||||
|
||||
# Обновляем все существующие строки значением по умолчанию
|
||||
op.execute(
|
||||
"UPDATE user_conditional_settings SET last_side = 'default_value' WHERE last_side IS NULL"
|
||||
)
|
||||
|
||||
# Устанавливаем ограничение NOT NULL
|
||||
op.alter_column('user_conditional_settings', 'last_side', nullable=False)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('user_conditional_settings', 'last_side')
|
||||
# ### end Alembic commands ###
|
Reference in New Issue
Block a user