Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused index idx_last_scheduling_decision on dag_run table #39275

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,46 @@
#
# 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.

"""Remove ``idx_last_scheduling_decision`` index on last_scheduling_decision in dag_run table

Revision ID: bff083ad727d
Revises: 677fdbb7fc54
Create Date: 2024-04-26 12:58:00.594762

"""

from alembic import op


# revision identifiers, used by Alembic.
revision = "bff083ad727d"
down_revision = "1949afb29106"
branch_labels = None
depends_on = None
airflow_version = "2.9.2"


def upgrade():
"""Apply Remove idx_last_scheduling_decision index on last_scheduling_decision in dag_run table"""
op.drop_index("idx_last_scheduling_decision", table_name="dag_run")


def downgrade():
"""Unapply Remove idx_last_scheduling_decision index on last_scheduling_decision in dag_run table"""
op.create_index("idx_last_scheduling_decision", "dag_run", ["last_scheduling_decision"],
unique=False)
Expand Up @@ -29,11 +29,11 @@


# revision identifiers, used by Alembic.
revision = '677fdbb7fc54'
down_revision = '1949afb29106'
revision = "677fdbb7fc54"
down_revision = "bff083ad727d"
branch_labels = None
depends_on = None
airflow_version = '2.10.0'
airflow_version = "2.10.0"


def upgrade():
Expand Down
1 change: 0 additions & 1 deletion airflow/models/dagrun.py
Expand Up @@ -159,7 +159,6 @@ class DagRun(Base, LoggingMixin):
Index("dag_id_state", dag_id, _state),
UniqueConstraint("dag_id", "execution_date", name="dag_run_dag_id_execution_date_key"),
UniqueConstraint("dag_id", "run_id", name="dag_run_dag_id_run_id_key"),
Index("idx_last_scheduling_decision", last_scheduling_decision),
Index("idx_dag_run_dag_id", dag_id),
Index(
"idx_dag_run_running_dags",
Expand Down
2 changes: 2 additions & 0 deletions airflow/utils/db.py
Expand Up @@ -91,6 +91,8 @@
"2.8.0": "10b52ebd31f7",
"2.8.1": "88344c1d9134",
"2.9.0": "1949afb29106",
"2.9.2": "bff083ad727d",
"2.10.0": "677fdbb7fc54",
}


Expand Down
2 changes: 1 addition & 1 deletion docs/apache-airflow/img/airflow_erd.sha256
@@ -1 +1 @@
77757e21aee500cb7fe7fd75e0f158633a0037d4d74e6f45eb14238f901ebacd
955a39c49c73c0ef63d55f428840c915438df4fd13abb5bfa2bd9cfe5f7c22ae
5 changes: 4 additions & 1 deletion docs/apache-airflow/migrations-ref.rst
Expand Up @@ -39,7 +39,10 @@ Here's the list of all the Database Migrations that are executed via when you ru
+---------------------------------+-------------------+-------------------+--------------------------------------------------------------+
| Revision ID | Revises ID | Airflow Version | Description |
+=================================+===================+===================+==============================================================+
| ``677fdbb7fc54`` (head) | ``1949afb29106`` | ``2.10.0`` | add new executor field to db |
| ``677fdbb7fc54`` (head) | ``bff083ad727d`` | ``2.10.0`` | add new executor field to db |
+---------------------------------+-------------------+-------------------+--------------------------------------------------------------+
| ``bff083ad727d`` | ``1949afb29106`` | ``2.9.2`` | Remove ``idx_last_scheduling_decision`` index on |
| | | | last_scheduling_decision in dag_run table |
+---------------------------------+-------------------+-------------------+--------------------------------------------------------------+
| ``1949afb29106`` | ``ee1467d4aa35`` | ``2.9.0`` | update trigger kwargs type and encrypt |
+---------------------------------+-------------------+-------------------+--------------------------------------------------------------+
Expand Down