kaxil opened a new pull request #13892:
URL: https://github.com/apache/airflow/pull/13892


   While developing locally to fix a Scheduler bug, I had to reset DB number of 
times and this particular
   migration caused problems (failed with following error):
   
   ```
   INFO  [alembic.runtime.migration] Running upgrade cf5dc11e79ad -> 
bbf4a7ad0465, Remove id column from xcom
   INFO  [alembic.runtime.migration] Running upgrade bbf4a7ad0465 -> 
b25a55525161, Increase length of pool name
   INFO  [alembic.runtime.migration] Running upgrade b25a55525161 -> 
3c20cacc0044, Add DagRun run_type
   INFO  [alembic.runtime.migration] Running upgrade 3c20cacc0044 -> 
8f966b9c467a, Set conn_type as non-nullable
   INFO  [alembic.runtime.migration] Running upgrade 8f966b9c467a -> 
8d48763f6d53, add unique constraint to conn_id
   INFO  [alembic.runtime.migration] Running upgrade 8d48763f6d53 -> 
e38be357a868, Add sensor_instance table
   Traceback (most recent call last):
     File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", 
line 1277, in _execute_context
       cursor, statement, parameters, context
     File 
"/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 
609, in do_execute
       cursor.execute(statement, parameters)
   psycopg2.errors.DuplicateTable: relation "sensor_instance" already exists
   ```
   
   Making it idempotent helps us to run it multiple times
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request 
Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines)**
 for more information.
   In case of fundamental code change, Airflow Improvement Proposal 
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals))
 is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party 
License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in 
[UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
   


----------------------------------------------------------------
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.

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


Reply via email to