Skip to content

Commit f8d3fce

Browse files
committed
rename instead of drop
1 parent db3d334 commit f8d3fce

File tree

1 file changed

+5
-2
lines changed
  • qiita_db/support_files/patches/python_patches

1 file changed

+5
-2
lines changed

qiita_db/support_files/patches/python_patches/18.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@
1818
# we know it has at least one of the columns, so drop both, and ignore
1919
# error if dropping non-existant column
2020
try:
21-
conn_handler.execute("ALTER TABLE qiita.%s DROP COLUMN study_id" % t)
21+
conn_handler.execute("ALTER TABLE qiita.%s RENAME COLUMN study_id TO "
22+
"study_id_template" % t)
2223
except PostgresError:
2324
pass
2425
try:
25-
conn_handler.execute("ALTER TABLE qiita.%s DROP COLUMN processed_data_id" % t)
26+
conn_handler.execute("ALTER TABLE qiita.%s RENAME COLUMN "
27+
"processed_data_id TO "
28+
"processed_data_id_template" % t)
2629
except PostgresError:
2730
pass

0 commit comments

Comments
 (0)