haldis/app/migrations/versions/old_migrations/2d696203e56_.py

54 lines
1.7 KiB
Python

"""Make it possible for some columns to be null
Revision ID: 2d696203e56
Revises: 354676f60be
Create Date: 2015-06-04 17:25:39.119678
"""
# revision identifiers, used by Alembic.
revision = '2d696203e56'
down_revision = '354676f60be'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.alter_column('location', 'name',
existing_type=sa.VARCHAR(length=120),
nullable=False)
op.alter_column('order_item', 'order_id',
existing_type=sa.INTEGER(),
nullable=False)
op.alter_column('product', 'name',
existing_type=sa.VARCHAR(length=120),
nullable=False)
op.alter_column('product', 'price',
existing_type=sa.INTEGER(),
nullable=False)
op.alter_column('user', 'username',
existing_type=sa.VARCHAR(length=80),
nullable=False)
### end Alembic commands ###
def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.alter_column('user', 'username',
existing_type=sa.VARCHAR(length=80),
nullable=True)
op.alter_column('product', 'price',
existing_type=sa.INTEGER(),
nullable=True)
op.alter_column('product', 'name',
existing_type=sa.VARCHAR(length=120),
nullable=True)
op.alter_column('order_item', 'order_id',
existing_type=sa.INTEGER(),
nullable=True)
op.alter_column('location', 'name',
existing_type=sa.VARCHAR(length=120),
nullable=True)
### end Alembic commands ###