Uploaded image for project: 'Apache Airflow'
  1. Apache Airflow
  2. AIRFLOW-6931

One migration failed during "airflow initdb" in mssql server 2017

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Reopened
    • Major
    • Resolution: Unresolved
    • 1.10.9
    • None
    • database
    • None
    • microsoft sqlserver 2017

    Description

      Running "airflw initdb" got error:

       _mssql.MSSQLDatabaseException: (5074, b"The object 'UQ__dag_run__F78A9899295C1915' is dependent on column 'execution_date'.DB-Lib error message 20018, severity 16:\nGeneral SQL Server error: Check messages from the SQL Server\nDB-Lib error message 20018, severity 16:\nGeneral SQL Server error: Check messages from the SQL Server\n")
      

      The issue is migration file 74effc47d867_change_datetime_to_datetime2_6_on_mssql_.py does not find all constraints.

      Confirmed that changing it to case-insensitive selection works:

      (tc.CONSTRAINT_TYPE = 'PRIMARY KEY' or LOWER(tc.CONSTRAINT_TYPE) = 'unique')

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              baoshan Baoshan Gu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: