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

husseinawala 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 8e38c5a4d7 Make connection login and password TEXT (#32815)
8e38c5a4d7 is described below

commit 8e38c5a4d74b86af25b018b19f7a7d90d3e7610f
Author: Sighery <[email protected]>
AuthorDate: Tue Sep 26 19:00:36 2023 +0200

    Make connection login and password TEXT (#32815)
---
 ...31_2_8_0_make_connection_login_password_text.py | 58 ++++++++++++++++++++++
 airflow/models/connection.py                       |  4 +-
 airflow/utils/db.py                                |  2 +-
 docs/apache-airflow/img/airflow_erd.sha256         |  2 +-
 docs/apache-airflow/img/airflow_erd.svg            | 12 ++---
 docs/apache-airflow/migrations-ref.rst             |  4 +-
 6 files changed, 71 insertions(+), 11 deletions(-)

diff --git 
a/airflow/migrations/versions/0131_2_8_0_make_connection_login_password_text.py 
b/airflow/migrations/versions/0131_2_8_0_make_connection_login_password_text.py
new file mode 100644
index 0000000000..f2a597a37f
--- /dev/null
+++ 
b/airflow/migrations/versions/0131_2_8_0_make_connection_login_password_text.py
@@ -0,0 +1,58 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""Make connection login/password TEXT
+
+Revision ID: bd5dfbe21f88
+Revises: f7bf2a57d0a6
+Create Date: 2023-09-14 17:16:24.942390
+
+"""
+
+import sqlalchemy as sa
+from alembic import op
+
+
+# revision identifiers, used by Alembic.
+revision = "bd5dfbe21f88"
+down_revision = "f7bf2a57d0a6"
+branch_labels = None
+depends_on = None
+airflow_version = "2.8.0"
+
+
+def upgrade():
+    """Apply Make connection login/password TEXT"""
+    with op.batch_alter_table("connection", schema=None) as batch_op:
+        batch_op.alter_column(
+            "login", existing_type=sa.VARCHAR(length=500), type_=sa.Text(), 
existing_nullable=True
+        )
+        batch_op.alter_column(
+            "password", existing_type=sa.VARCHAR(length=5000), 
type_=sa.Text(), existing_nullable=True
+        )
+
+
+def downgrade():
+    """Unapply Make connection login/password TEXT"""
+    with op.batch_alter_table("connection", schema=None) as batch_op:
+        batch_op.alter_column(
+            "password", existing_type=sa.Text(), 
type_=sa.VARCHAR(length=5000), existing_nullable=True
+        )
+        batch_op.alter_column(
+            "login", existing_type=sa.Text(), type_=sa.VARCHAR(length=500), 
existing_nullable=True
+        )
diff --git a/airflow/models/connection.py b/airflow/models/connection.py
index f67d7800e1..373c10f326 100644
--- a/airflow/models/connection.py
+++ b/airflow/models/connection.py
@@ -93,8 +93,8 @@ class Connection(Base, LoggingMixin):
     description = Column(Text().with_variant(Text(5000), 
"mysql").with_variant(String(5000), "sqlite"))
     host = Column(String(500))
     schema = Column(String(500))
-    login = Column(String(500))
-    _password = Column("password", String(5000))
+    login = Column(Text())
+    _password = Column("password", Text())
     port = Column(Integer())
     is_encrypted = Column(Boolean, unique=False, default=False)
     is_extra_encrypted = Column(Boolean, unique=False, default=False)
diff --git a/airflow/utils/db.py b/airflow/utils/db.py
index 9108ec2e59..d958123c50 100644
--- a/airflow/utils/db.py
+++ b/airflow/utils/db.py
@@ -88,7 +88,7 @@ _REVISION_HEADS_MAP = {
     "2.6.0": "98ae134e6fff",
     "2.6.2": "c804e5c76e3e",
     "2.7.0": "405de8318b3a",
-    "2.8.0": "f7bf2a57d0a6",
+    "2.8.0": "bd5dfbe21f88",
 }
 
 
diff --git a/docs/apache-airflow/img/airflow_erd.sha256 
b/docs/apache-airflow/img/airflow_erd.sha256
index c9b7add48f..07d7b9b528 100644
--- a/docs/apache-airflow/img/airflow_erd.sha256
+++ b/docs/apache-airflow/img/airflow_erd.sha256
@@ -1 +1 @@
-cb63ebc505496790af2d45e0746b4641ed3cc26831f8a5980d8088babaeb43c3
\ No newline at end of file
+a918c5979b82997b01f55f5a4242a0e6ae8ecc9f316c63ac42f6024c348cdfde
\ No newline at end of file
diff --git a/docs/apache-airflow/img/airflow_erd.svg 
b/docs/apache-airflow/img/airflow_erd.svg
index 197423aabe..33f603ac29 100644
--- a/docs/apache-airflow/img/airflow_erd.svg
+++ b/docs/apache-airflow/img/airflow_erd.svg
@@ -316,10 +316,10 @@
 <text text-anchor="start" x="189.5" y="-1364.8" 
font-family="Helvetica,sans-Serif" font-size="14.00"> [BOOLEAN]</text>
 <polygon fill="none" stroke="black" points="52.5,-1330 52.5,-1355 331.5,-1355 
331.5,-1330 52.5,-1330"/>
 <text text-anchor="start" x="57.5" y="-1339.8" 
font-family="Helvetica,sans-Serif" font-size="14.00">login</text>
-<text text-anchor="start" x="91.5" y="-1339.8" 
font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(500)]</text>
+<text text-anchor="start" x="91.5" y="-1339.8" 
font-family="Helvetica,sans-Serif" font-size="14.00"> [TEXT]</text>
 <polygon fill="none" stroke="black" points="52.5,-1305 52.5,-1330 331.5,-1330 
331.5,-1305 52.5,-1305"/>
 <text text-anchor="start" x="57.5" y="-1314.8" 
font-family="Helvetica,sans-Serif" font-size="14.00">password</text>
-<text text-anchor="start" x="124.5" y="-1314.8" 
font-family="Helvetica,sans-Serif" font-size="14.00"> [VARCHAR(5000)]</text>
+<text text-anchor="start" x="124.5" y="-1314.8" 
font-family="Helvetica,sans-Serif" font-size="14.00"> [TEXT]</text>
 <polygon fill="none" stroke="black" points="52.5,-1280 52.5,-1305 331.5,-1305 
331.5,-1280 52.5,-1280"/>
 <text text-anchor="start" x="57.5" y="-1289.8" 
font-family="Helvetica,sans-Serif" font-size="14.00">port</text>
 <text text-anchor="start" x="86.5" y="-1289.8" 
font-family="Helvetica,sans-Serif" font-size="14.00"> [INTEGER]</text>
@@ -1218,28 +1218,28 @@
 <g id="edge46" class="edge">
 <title>task_instance&#45;&#45;xcom</title>
 <path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" 
d="M1114.45,-2160.17C1147.39,-2079.52 1188.61,-1998.03 1239,-1929 
1244.85,-1920.99 1251.31,-1913.19 1258.19,-1905.69"/>
-<text text-anchor="start" x="1227.19" y="-1894.49" font-family="Times,serif" 
font-size="14.00">0..N</text>
+<text text-anchor="start" x="1248.19" y="-1894.49" font-family="Times,serif" 
font-size="14.00">1</text>
 <text text-anchor="start" x="1104.45" y="-2148.97" font-family="Times,serif" 
font-size="14.00">1</text>
 </g>
 <!-- task_instance&#45;&#45;xcom -->
 <g id="edge47" class="edge">
 <title>task_instance&#45;&#45;xcom</title>
 <path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" 
d="M1121.68,-2160.36C1153.36,-2085.87 1192.23,-2011.07 1239,-1947 
1244.85,-1938.99 1251.31,-1931.19 1258.19,-1923.67"/>
-<text text-anchor="start" x="1248.19" y="-1912.47" font-family="Times,serif" 
font-size="14.00">1</text>
+<text text-anchor="start" x="1227.19" y="-1912.47" font-family="Times,serif" 
font-size="14.00">0..N</text>
 <text text-anchor="start" x="1121.68" y="-2149.16" font-family="Times,serif" 
font-size="14.00">1</text>
 </g>
 <!-- task_instance&#45;&#45;xcom -->
 <g id="edge48" class="edge">
 <title>task_instance&#45;&#45;xcom</title>
 <path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" 
d="M1129.34,-2160.34C1159.57,-2092.09 1195.93,-2024 1239,-1965 1244.85,-1956.99 
1251.31,-1949.19 1258.19,-1941.64"/>
-<text text-anchor="start" x="1227.19" y="-1930.44" font-family="Times,serif" 
font-size="14.00">0..N</text>
+<text text-anchor="start" x="1248.19" y="-1930.44" font-family="Times,serif" 
font-size="14.00">1</text>
 <text text-anchor="start" x="1129.34" y="-2149.14" font-family="Times,serif" 
font-size="14.00">1</text>
 </g>
 <!-- task_instance&#45;&#45;xcom -->
 <g id="edge49" class="edge">
 <title>task_instance&#45;&#45;xcom</title>
 <path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" 
d="M1137.45,-2160.12C1166.01,-2098.2 1199.71,-2036.81 1239,-1983 
1248.13,-1970.5 1258.77,-1958.5 1270.11,-1947.08"/>
-<text text-anchor="start" x="1260.11" y="-1950.88" font-family="Times,serif" 
font-size="14.00">1</text>
+<text text-anchor="start" x="1239.11" y="-1950.88" font-family="Times,serif" 
font-size="14.00">0..N</text>
 <text text-anchor="start" x="1137.45" y="-2148.92" font-family="Times,serif" 
font-size="14.00">1</text>
 </g>
 <!-- log_template -->
diff --git a/docs/apache-airflow/migrations-ref.rst 
b/docs/apache-airflow/migrations-ref.rst
index f0b2b121f5..72f467f6fb 100644
--- a/docs/apache-airflow/migrations-ref.rst
+++ b/docs/apache-airflow/migrations-ref.rst
@@ -39,7 +39,9 @@ Here's the list of all the Database Migrations that are 
executed via when you ru
 
+---------------------------------+-------------------+-------------------+--------------------------------------------------------------+
 | Revision ID                     | Revises ID        | Airflow Version   | 
Description                                                  |
 
+=================================+===================+===================+==============================================================+
-| ``f7bf2a57d0a6`` (head)         | ``375a816bbbf4``  | ``2.8.0``         | 
Add owner_display_name to (Audit) Log table                  |
+| ``bd5dfbe21f88`` (head)         | ``f7bf2a57d0a6``  | ``2.8.0``         | 
Make connection login/password TEXT                          |
++---------------------------------+-------------------+-------------------+--------------------------------------------------------------+
+| ``f7bf2a57d0a6``                | ``375a816bbbf4``  | ``2.8.0``         | 
Add owner_display_name to (Audit) Log table                  |
 
+---------------------------------+-------------------+-------------------+--------------------------------------------------------------+
 | ``375a816bbbf4``                | ``405de8318b3a``  | ``2.8.0``         | 
add new field 'clear_number' to dagrun                       |
 
+---------------------------------+-------------------+-------------------+--------------------------------------------------------------+

Reply via email to