You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2019/10/02 11:09:00 UTC

[jira] [Commented] (AIRFLOW-5342) Can't run initdb using Microsoft SQL server

    [ https://issues.apache.org/jira/browse/AIRFLOW-5342?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16942702#comment-16942702 ] 

ASF subversion and git services commented on AIRFLOW-5342:
----------------------------------------------------------

Commit f9981670c14da842b8ce351dfc90b6ad271b42ca in airflow's branch refs/heads/v1-10-stable from Morten Post
[ https://gitbox.apache.org/repos/asf?p=airflow.git;h=f998167 ]

[AIRFLOW-5342] Fix MSSQL breaking task_instance db migration

MSSQL does not allow altering columns to NOT NULL when the column
is used in an index. Therefore we drop the ti_pool index and recreate
it after modifying the column.

Co-authored-by: mattinbits <37...@users.noreply.github.com>
Co-authored-by: sirVir <si...@users.noreply.github.com>
(cherry picked from commit f1674e30d36c617e95e3b3762739197932726f4e)


> Can't run initdb using Microsoft SQL server
> -------------------------------------------
>
>                 Key: AIRFLOW-5342
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-5342
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: configuration, core, database
>    Affects Versions: 1.10.4
>            Reporter: Adam Trump
>            Assignee: Morten Post
>            Priority: Critical
>             Fix For: 1.10.6
>
>
> I'm using Microsoft SQL server 2016 as metadata db (for the sql_alchemy_conn), and pymssql as the Python driver.
> When running airflow initdb, airflow creates a table named `TaskInstance` with column `pool` that is initially Nullable (when the table is created).
> Later, an index named `ti_pool` on a few columns, including `pool` column in table `TaskInstance`.
> Then, airflow will try to alter table `TaskInstance` and change the column `pool` to `NOT NULL`.
> This does not work on Microsoft SQL Server since a column with an index defined on it cannot be changed, unless the index is deleted before.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)