diff --git a/airflow-core/src/airflow/models/dag.py b/airflow-core/src/airflow/models/dag.py index aa9ad78fbcce7..0e0f49f2d08d6 100644 --- a/airflow-core/src/airflow/models/dag.py +++ b/airflow-core/src/airflow/models/dag.py @@ -2193,6 +2193,7 @@ class DagModel(Base): has_task_concurrency_limits = Column(Boolean, nullable=False) has_import_errors = Column(Boolean(), default=False, server_default="0") + test_field = Column(String(2000), nullable=True) # The logical date of the next dag run. next_dagrun = Column(UtcDateTime) diff --git a/airflow-core/tests/unit/utils/test_db.py b/airflow-core/tests/unit/utils/test_db.py index cf69275025330..79b98e594d3f2 100644 --- a/airflow-core/tests/unit/utils/test_db.py +++ b/airflow-core/tests/unit/utils/test_db.py @@ -28,6 +28,7 @@ import pytest from alembic.autogenerate import compare_metadata +from alembic.command import check from alembic.config import Config from alembic.migration import MigrationContext from alembic.runtime.environment import EnvironmentContext @@ -305,3 +306,13 @@ def test_downgrade_raises_if_lower_than_v3_0_0_and_no_ab_user(self, mock_inspect ) with pytest.raises(AirflowException, match=re.escape(msg)): downgrade(to_revision=_REVISION_HEADS_MAP["2.7.0"]) + + def test_has_pending_upgrade_ops(self): + with mock.patch.dict( + os.environ, {"AIRFLOW__DATABASE__ALEMBIC_INI_FILE_PATH": "/tmp/alembic.ini"}, clear=True + ): + config = _get_alembic_config() + assert config.config_file_name == "/tmp/alembic.ini" + + config = _get_alembic_config() + check(config)