Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion airflow-core/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ repos:
pass_filenames: true
files: ^src/airflow/migrations/versions/.*\.py$
exclude:
^src/airflow/migrations/versions/0028_3_0_0_drop_ab_user_id_foreign_key.py$
(?x)
^src/airflow/migrations/versions/0000_2_6_2_squashed_migrations\.py$|
^src/airflow/migrations/versions/0028_3_0_0_drop_ab_user_id_foreign_key\.py$
- id: ts-compile-lint-ui
name: Compile / format / lint UI
description: TS types generation / ESLint / Prettier new UI files
Expand Down
2 changes: 1 addition & 1 deletion airflow-core/docs/img/airflow_erd.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
99114dbbb7c6e7ae792b0dd380c55901aea3185c7e8f969c2e44b8fa69e2a467
5e7215fa50868683623f2f4ff4e1ede41beeda84acb141eb3f36c854b9b24314
120 changes: 60 additions & 60 deletions airflow-core/docs/img/airflow_erd.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion airflow-core/docs/migrations-ref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ Here's the list of all the Database Migrations that are executed via when you ru
+-------------------------+------------------+-------------------+--------------------------------------------------------------+
| ``788397e78828`` | ``937cbd173ca1`` | ``2.7.0`` | Add custom_operator_name column. |
+-------------------------+------------------+-------------------+--------------------------------------------------------------+
| ``937cbd173ca1`` (base) | ``None`` | ``2.7.0`` | Add index to task_instance table. |
| ``937cbd173ca1`` | ``4bc4d934e2bc`` | ``2.7.0`` | Add index to task_instance table. |
+-------------------------+------------------+-------------------+--------------------------------------------------------------+
| ``4bc4d934e2bc`` (base) | ``None`` | ``2.6.2`` | Create initial database state from Airflow v2.6.2. |
+-------------------------+------------------+-------------------+--------------------------------------------------------------+

.. End of auto-generated table
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
Add index to task_instance table.

Revision ID: 937cbd173ca1
Revises: None
Revises: 4bc4d934e2bc
Create Date: 2023-05-03 11:31:32.527362

"""
Expand All @@ -31,7 +31,7 @@

# revision identifiers, used by Alembic.
revision = "937cbd173ca1"
down_revision = None
down_revision = "4bc4d934e2bc"
branch_labels = None
depends_on = None
airflow_version = "2.7.0"
Expand Down
5 changes: 3 additions & 2 deletions airflow-core/src/airflow/utils/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class MappedClassProtocol(Protocol):
log = logging.getLogger(__name__)

_REVISION_HEADS_MAP: dict[str, str] = {
"2.6.2": "4bc4d934e2bc",
"2.7.0": "405de8318b3a",
"2.8.0": "10b52ebd31f7",
"2.8.1": "88344c1d9134",
Expand Down Expand Up @@ -167,7 +168,7 @@ def add_default_pool_if_not_exists(session: Session = NEW_SESSION):
"""Add default pool if it does not exist."""
from airflow.models.pool import Pool

if not Pool.get_pool(Pool.DEFAULT_POOL_NAME, session=session):
if not session.scalar(select(Pool.id).where(Pool.pool == Pool.DEFAULT_POOL_NAME)):
default_pool = Pool(
pool=Pool.DEFAULT_POOL_NAME,
slots=conf.getint(section="core", key="default_pool_task_slot_count"),
Expand Down Expand Up @@ -1118,7 +1119,7 @@ def upgradedb(
if errors_seen:
exit(1)

if not _get_current_revision(session=session):
if not _get_current_revision(session=session) and not to_revision:
# Don't load default connections
# New DB; initialize and exit
initdb(session=session)
Expand Down
2 changes: 1 addition & 1 deletion scripts/in_container/run_migration_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def update_docs(revisions: Iterable[Script], app="airflow"):


def ensure_mod_prefix(mod_name, idx, version):
parts = [f"{idx + 1:04}", *version]
parts = [f"{idx:04}", *version]
match = re.match(r"([0-9]+)_([0-9]+)_([0-9]+)_([0-9]+)_(.+)", mod_name)
if match:
# previously standardized file, rebuild the name
Expand Down
Loading