You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/11/24 09:49:00 UTC

[GitHub] [airflow] ephraimbuddy opened a new pull request, #27886: Explicitly name the primary keys in ORM for task & dagrun notes table

ephraimbuddy opened a new pull request, #27886:
URL: https://github.com/apache/airflow/pull/27886

   This was omitted but it's important for future migrations
   
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] dstandish commented on pull request #27886: Explicitly name the primary keys in ORM for task & dagrun notes table

Posted by GitBox <gi...@apache.org>.
dstandish commented on PR #27886:
URL: https://github.com/apache/airflow/pull/27886#issuecomment-1326530995

   This wants to be a precommit


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] ephraimbuddy commented on a diff in pull request #27886: Explicitly name the primary keys in ORM for task & dagrun notes table

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on code in PR #27886:
URL: https://github.com/apache/airflow/pull/27886#discussion_r1031367908


##########
airflow/models/dagrun.py:
##########
@@ -1314,7 +1314,7 @@ class DagRunNote(Base):
     __tablename__ = "dag_run_note"
 
     user_id = Column(Integer, nullable=True)
-    dag_run_id = Column(Integer, primary_key=True, nullable=False)
+    dag_run_id = Column(Integer, primary_key=True, name="dag_run_note_pkey", nullable=False)

Review Comment:
   It works. Unless you have a composite key then it does not work



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] uranusjr commented on a diff in pull request #27886: Explicitly name the primary keys in ORM for task & dagrun notes table

Posted by GitBox <gi...@apache.org>.
uranusjr commented on code in PR #27886:
URL: https://github.com/apache/airflow/pull/27886#discussion_r1031362533


##########
airflow/models/dagrun.py:
##########
@@ -1314,7 +1314,7 @@ class DagRunNote(Base):
     __tablename__ = "dag_run_note"
 
     user_id = Column(Integer, nullable=True)
-    dag_run_id = Column(Integer, primary_key=True, nullable=False)
+    dag_run_id = Column(Integer, primary_key=True, name="dag_run_note_pkey", nullable=False)

Review Comment:
   Ah good catch, it does not. We need a PrimaryKeyConstraint in `__table_args__` instead.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] ephraimbuddy commented on a diff in pull request #27886: Explicitly name the primary keys in ORM for task & dagrun notes table

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on code in PR #27886:
URL: https://github.com/apache/airflow/pull/27886#discussion_r1031398043


##########
airflow/models/dagrun.py:
##########
@@ -1314,7 +1314,7 @@ class DagRunNote(Base):
     __tablename__ = "dag_run_note"
 
     user_id = Column(Integer, nullable=True)
-    dag_run_id = Column(Integer, primary_key=True, nullable=False)
+    dag_run_id = Column(Integer, primary_key=True, name="dag_run_note_pkey", nullable=False)

Review Comment:
   Yeah. You are right @uranusjr . The naming convention was what was making the name appear as if this is working. I will change it



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] ashb commented on a diff in pull request #27886: Explicitly name the primary keys in ORM for task & dagrun notes table

Posted by GitBox <gi...@apache.org>.
ashb commented on code in PR #27886:
URL: https://github.com/apache/airflow/pull/27886#discussion_r1031360299


##########
airflow/models/dagrun.py:
##########
@@ -1314,7 +1314,7 @@ class DagRunNote(Base):
     __tablename__ = "dag_run_note"
 
     user_id = Column(Integer, nullable=True)
-    dag_run_id = Column(Integer, primary_key=True, nullable=False)
+    dag_run_id = Column(Integer, primary_key=True, name="dag_run_note_pkey", nullable=False)

Review Comment:
   Does this work?



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] ephraimbuddy commented on a diff in pull request #27886: Explicitly name the primary keys in ORM for task & dagrun notes table

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on code in PR #27886:
URL: https://github.com/apache/airflow/pull/27886#discussion_r1031369717


##########
airflow/models/dagrun.py:
##########
@@ -1314,7 +1314,7 @@ class DagRunNote(Base):
     __tablename__ = "dag_run_note"
 
     user_id = Column(Integer, nullable=True)
-    dag_run_id = Column(Integer, primary_key=True, nullable=False)
+    dag_run_id = Column(Integer, primary_key=True, name="dag_run_note_pkey", nullable=False)

Review Comment:
   You can test with sqlite:
   `breeze --backend sqlite`
   `airflow db init`
   `airflow db shell`
   `.schema dag_run_note`



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] ephraimbuddy merged pull request #27886: Explicitly name the primary keys in ORM for task & dagrun notes table

Posted by GitBox <gi...@apache.org>.
ephraimbuddy merged PR #27886:
URL: https://github.com/apache/airflow/pull/27886


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] dstandish commented on pull request #27886: Explicitly name the primary keys in ORM for task & dagrun notes table

Posted by GitBox <gi...@apache.org>.
dstandish commented on PR #27886:
URL: https://github.com/apache/airflow/pull/27886#issuecomment-1326452511

   Thanks @ephraimbuddy 


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org