You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ep...@apache.org on 2022/10/12 13:12:06 UTC

[airflow] branch main updated: Fix migration issue in upgrade using `type_` instead of `server_default` (#27009)

This is an automated email from the ASF dual-hosted git repository.

ephraimanierobi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 1d132d50dd Fix migration issue in upgrade using `type_` instead of `server_default` (#27009)
1d132d50dd is described below

commit 1d132d50ddf6025a37ab7c136b5ce430fad60660
Author: Ephraim Anierobi <sp...@gmail.com>
AuthorDate: Wed Oct 12 14:11:51 2022 +0100

    Fix migration issue in upgrade using `type_` instead of `server_default` (#27009)
    
    This was failing but was not noticed due to an issue with breeze.
    We should use `server_default` instead of `type_` since `sequence` is the default when table is described.
    The `type_` remains an integer with the added sequence
---
 airflow/migrations/versions/0118_2_4_2_add_missing_autoinc_fab.py | 2 +-
 docs/apache-airflow/img/airflow_erd.sha256                        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/airflow/migrations/versions/0118_2_4_2_add_missing_autoinc_fab.py b/airflow/migrations/versions/0118_2_4_2_add_missing_autoinc_fab.py
index f6becd9dfe..69b0e231d1 100644
--- a/airflow/migrations/versions/0118_2_4_2_add_missing_autoinc_fab.py
+++ b/airflow/migrations/versions/0118_2_4_2_add_missing_autoinc_fab.py
@@ -67,7 +67,7 @@ def upgrade():
         with op.batch_alter_table(table) as batch:
             kwargs = {}
             if conn.dialect.name == 'postgresql':
-                kwargs['type_'] = sa.Sequence(f'{table}_id_seq').next_value()
+                kwargs['server_default'] = sa.Sequence(f'{table}_id_seq').next_value()
             else:
                 kwargs['autoincrement'] = True
             batch.alter_column("id", existing_type=sa.Integer(), existing_nullable=False, **kwargs)
diff --git a/docs/apache-airflow/img/airflow_erd.sha256 b/docs/apache-airflow/img/airflow_erd.sha256
index 26f6e90fbf..bf9c204a6f 100644
--- a/docs/apache-airflow/img/airflow_erd.sha256
+++ b/docs/apache-airflow/img/airflow_erd.sha256
@@ -1 +1 @@
-5d0b9bcb02f09e99338b2c230cf2c7b1e8af7f7ea675eca6f31e49e851e11941
\ No newline at end of file
+dca9bf08dd97b5f51c387726a2e9d25996769e85dda0d403e8e088ce222faa09
\ No newline at end of file