def METHOD_NAME():
    with op.batch_alter_table('predictor', schema=None) as batch_op:
        batch_op.add_column(sa.Column('dataset_id', sa.INTEGER(), nullable=True))
        batch_op.drop_constraint('fk_integration_id', type_='foreignkey')
        batch_op.create_foreign_key('fk_predictor_dataset_id', 'dataset', ['dataset_id'], ['id'])
        batch_op.drop_column('fetch_data_query')
        batch_op.drop_column('integration_id')
    op.create_table(
        'analysis',
        sa.Column('id', sa.INTEGER(), nullable=False),
        sa.Column('analysis', sa.VARCHAR(), nullable=False),
        sa.Column('created_at', sa.DATETIME(), nullable=True),
        sa.Column('updated_at', sa.DATETIME(), nullable=True),
        sa.PrimaryKeyConstraint('id')
    )
    op.create_table(
        'dataset',
        sa.Column('id', sa.INTEGER(), nullable=False),
        sa.Column('updated_at', sa.DATETIME(), nullable=True),
        sa.Column('created_at', sa.DATETIME(), nullable=True),
        sa.Column('name', sa.VARCHAR(), nullable=True),
        sa.Column('data', sa.VARCHAR(), nullable=True),
        sa.Column('creation_info', sa.VARCHAR(), nullable=True),
        sa.Column('company_id', sa.INTEGER(), nullable=True),
        sa.Column('mindsdb_version', sa.VARCHAR(), nullable=True),
        sa.Column('datasources_version', sa.VARCHAR(), nullable=True),
        sa.Column('integration_id', sa.INTEGER(), nullable=True),
        sa.Column('analysis_id', sa.INTEGER(), nullable=True),
        sa.Column('ds_class', sa.VARCHAR(), nullable=True),
        sa.ForeignKeyConstraint(['analysis_id'], ['analysis.id'], name='fk_ds_analysis_id'),
        sa.ForeignKeyConstraint(['integration_id'], ['integration.id'], name='fk_integration_id'),
        sa.PrimaryKeyConstraint('id'),
        sa.UniqueConstraint('name', 'company_id', name='unique_dataset_name_company_id')
    )
    with op.batch_alter_table('file', schema=None) as batch_op:
        batch_op.add_column(sa.Column('analysis_id', sa.INTEGER(), nullable=True))
        batch_op.create_foreign_key('fk_analysis_id', 'analysis', ['analysis_id'], ['id'])
        batch_op.create_unique_constraint('unique_file_name_company_id', ['name', 'company_id'])