"""query_context

Revision ID: 6cb02dfd7f61
Revises: b0382f5be48d
Create Date: 2023-10-03 12:36:00.008731

"""
from alembic import op
import sqlalchemy as sa
import mindsdb.interfaces.storage.db # noqa


# revision identifiers, used by Alembic.
revision = '6cb02dfd7f61'
down_revision = 'b0382f5be48d'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'query_context',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('company_id', sa.Integer(), nullable=True),
        sa.Column('query', sa.String(), nullable=False),
        sa.Column('context_name', sa.String(), nullable=False),
        sa.Column('values', sa.JSON(), nullable=True),
        sa.Column('updated_at', sa.DateTime(), nullable=True),
        sa.Column('created_at', sa.DateTime(), nullable=True),
        sa.PrimaryKeyConstraint('id')
    )


def downgrade():

    op.drop_table('query_context')
    # ### end Alembic commands ###
