You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/03/18 01:50:59 UTC

[GitHub] [airflow] ephraimbuddy commented on a change in pull request #22353: Use Airflow.Base.metadata in FAB models

ephraimbuddy commented on a change in pull request #22353:
URL: https://github.com/apache/airflow/pull/22353#discussion_r829637799



##########
File path: airflow/migrations/versions/0058_03afc6b6f902_increase_length_of_fab_ab_view_menu_.py
##########
@@ -40,57 +38,23 @@
 
 def upgrade():
     """Apply Increase length of ``Flask-AppBuilder`` ``ab_view_menu.name`` column"""
-    conn = op.get_bind()
-    inspector = inspect(conn)
-    tables = inspector.get_table_names()
-
-    if "ab_view_menu" in tables:
-        if conn.dialect.name == "sqlite":
-            op.execute("PRAGMA foreign_keys=off")
-            op.execute(
-                """
-            CREATE TABLE IF NOT EXISTS ab_view_menu_dg_tmp
-            (
-                id INTEGER NOT NULL PRIMARY KEY,
-                name VARCHAR(250) NOT NULL UNIQUE
-            );

Review comment:
       This migration dropped the unique key constraint on the name for SQLite. I had to do it with batch mode since there's now batch mode support




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org