gyan/gyan/db/sqlalchemy/alembic/versions/f3bf9414f399_add_ml_type_an...

39 lines
1.3 KiB
Python

"""Add ml_type and ml_data to ml_model table
Revision ID: f3bf9414f399
Revises: cebd81b206ca
Create Date: 2018-10-13 09:48:36.783322
"""
# revision identifiers, used by Alembic.
revision = 'f3bf9414f399'
down_revision = 'cebd81b206ca'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('compute_host', schema=None) as batch_op:
batch_op.alter_column('hostname',
existing_type=mysql.VARCHAR(length=255),
nullable=False)
batch_op.alter_column('status',
existing_type=mysql.VARCHAR(length=255),
nullable=False)
batch_op.alter_column('type',
existing_type=mysql.VARCHAR(length=255),
nullable=False)
with op.batch_alter_table('ml_model', schema=None) as batch_op:
batch_op.add_column(sa.Column('ml_data', sa.LargeBinary(length=(2**32)-1), nullable=True))
batch_op.add_column(sa.Column('ml_type', sa.String(length=255), nullable=True))
batch_op.add_column(sa.Column('started_at', sa.DateTime(), nullable=True))
batch_op.create_unique_constraint('uniq_mlmodel0uuid', ['id'])
# ### end Alembic commands ###