dstandish commented on code in PR #42277:
URL: https://github.com/apache/airflow/pull/42277#discussion_r1763617309


##########
airflow/migrations/versions/0032_3_0_0_add_tables_for_backfill.py:
##########
@@ -0,0 +1,88 @@
+#
+# 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.
+
+"""
+Add tables for backfill.
+
+Revision ID: 522625f6d606
+Revises: 1cdc775ca98f
+Create Date: 2024-08-23 14:26:08.250493
+
+"""
+
+from __future__ import annotations
+
+import sqlalchemy as sa
+import sqlalchemy_jsonfield
+from alembic import op
+
+import airflow
+
+# revision identifiers, used by Alembic.
+revision = "522625f6d606"
+down_revision = "1cdc775ca98f"
+branch_labels = None
+depends_on = None
+airflow_version = "3.0.0"
+
+
+def upgrade():
+    """Apply Add tables for backfill."""
+    # ### commands auto generated by Alembic - please adjust! ###
+    op.create_table(
+        "backfill",
+        sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
+        sa.Column("dag_id", sa.String(length=250), nullable=True),
+        sa.Column("from_date", 
airflow.utils.sqlalchemy.UtcDateTime(timezone=True), nullable=False),
+        sa.Column("to_date", 
airflow.utils.sqlalchemy.UtcDateTime(timezone=True), nullable=False),
+        sa.Column("dag_run_conf", sqlalchemy_jsonfield.jsonfield.JSONField(), 
nullable=True),
+        sa.Column("is_paused", sa.Boolean(), nullable=True),
+        sa.Column("max_active_runs", sa.Integer(), nullable=False),
+        sa.Column("created_at", 
airflow.utils.sqlalchemy.UtcDateTime(timezone=True), nullable=False),
+        sa.Column("completed_at", 
airflow.utils.sqlalchemy.UtcDateTime(timezone=True), nullable=True),
+        sa.Column("updated_at", 
airflow.utils.sqlalchemy.UtcDateTime(timezone=True), nullable=False),
+        sa.PrimaryKeyConstraint("id", name=op.f("backfill_pkey")),
+    )
+    op.create_table(
+        "backfill_dag_run",
+        sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
+        sa.Column("backfill_id", sa.Integer(), nullable=False),
+        sa.Column("dag_run_id", sa.Integer(), nullable=True),

Review Comment:
   the intention is to be able to record what happens when a particular 
backfill request has a range that includes a dag run that already exists.  in 
that case we could create this mapping record but indicate that no run was 
created and why.  that's the thought anyway.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to