Files
syops/backend/migrations/versions/510db8a4f806_initial_migration.py
T

51 lines
1.5 KiB
Python

"""Initial migration
Revision ID: 510db8a4f806
Revises:
Create Date: 2026-02-23 11:16:09.218508
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '510db8a4f806'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('agents', schema=None) as batch_op:
batch_op.alter_column('type',
existing_type=sa.VARCHAR(length=20),
nullable=False,
existing_server_default=sa.text("'api'::character varying"))
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.alter_column('status',
existing_type=sa.VARCHAR(length=20),
nullable=False,
existing_server_default=sa.text("'active'::character varying"))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.alter_column('status',
existing_type=sa.VARCHAR(length=20),
nullable=True,
existing_server_default=sa.text("'active'::character varying"))
with op.batch_alter_table('agents', schema=None) as batch_op:
batch_op.alter_column('type',
existing_type=sa.VARCHAR(length=20),
nullable=True,
existing_server_default=sa.text("'api'::character varying"))
# ### end Alembic commands ###