Skip to content

Instantly share code, notes, and snippets.

@will-moore
Last active May 19, 2016 13:47
Show Gist options
  • Save will-moore/b03318d44bbce7f8289970b6e1748fe6 to your computer and use it in GitHub Desktop.
Save will-moore/b03318d44bbce7f8289970b6e1748fe6 to your computer and use it in GitHub Desktop.
omero=# select * from dbpatch;
id | currentpatch | currentversion | permissions | finished | message | previouspatch | previousversion | external_id
----+--------------+----------------+-------------+----------------------------+----------------------------------------------------------------------------------------------+---------------+-----------------+-------------
28 | 19 | OMERO5.1DEV | -52 | 2015-02-17 10:50:02.216445 | Database updated. | 18 | OMERO5.1DEV |
1 | 7 | OMERO5.1DEV | -52 | 2014-07-24 11:11:25.913143 | Database ready. | 0 | OMERO5.1DEV |
2 | 8 | OMERO5.1DEV | -52 | 2014-08-19 11:18:11.136204 | Database updated. | 7 | OMERO5.1DEV |
3 | 8 | OMERO5.1DEV | -52 | 2014-08-19 11:19:34.042389 | DB check DBEnumCheck: done for Bio-Formats revision 87fbabc | 8 | OMERO5.1DEV |
4 | 8 | OMERO5.1DEV | -52 | 2014-09-18 15:52:48.100587 | DB check DBEnumCheck: done for Bio-Formats revision 0819d22 | 8 | OMERO5.1DEV |
5 | 9 | OMERO5.1DEV | -52 | 2014-09-30 21:16:11.409138 | Database updated. | 8 | OMERO5.1DEV |
6 | 10 | OMERO5.1DEV | -52 | 2014-09-30 21:16:36.901624 | Database updated. | 9 | OMERO5.1DEV |
7 | 10 | OMERO5.1DEV | -52 | 2014-09-30 21:17:12.313188 | DB check DBEnumCheck: done for Bio-Formats revision 645a6c2 | 10 | OMERO5.1DEV |
8 | 10 | OMERO5.1DEV | -52 | 2014-10-06 14:36:46.20051 | DB check DBEnumCheck: done for Bio-Formats revision 3bfc00c | 10 | OMERO5.1DEV |
9 | 10 | OMERO5.1DEV | -52 | 2014-10-14 11:38:58.93815 | DB check DBEnumCheck: done for Bio-Formats revision 5706a61 | 10 | OMERO5.1DEV |
10 | 11 | OMERO5.1DEV | -52 | 2014-10-27 14:22:51.934995 | Database updated. | 10 | OMERO5.1DEV |
11 | 11 | OMERO5.1DEV | -52 | 2014-10-27 14:24:34.595282 | DB check DBEnumCheck: done for Bio-Formats revision efc70d8 | 11 | OMERO5.1DEV |
12 | 12 | OMERO5.1DEV | -52 | 2014-11-11 16:12:30.824569 | Database updated. | 11 | OMERO5.1DEV |
13 | 12 | OMERO5.1DEV | -52 | 2014-11-11 16:12:55.95119 | DB check DBEnumCheck: done for Bio-Formats revision 2c7c6a7 | 12 | OMERO5.1DEV |
14 | 13 | OMERO5.1DEV | -52 | 2014-11-14 11:42:04.453606 | Database updated. | 12 | OMERO5.1DEV |
15 | 13 | OMERO5.1DEV | -52 | 2014-11-14 11:44:26.644384 | DB check DBEnumCheck: done for Bio-Formats revision d2d22db | 13 | OMERO5.1DEV |
16 | 14 | OMERO5.1DEV | -52 | 2014-11-25 21:09:21.417323 | Database updated. | 13 | OMERO5.1DEV |
17 | 15 | OMERO5.1DEV | -52 | 2014-11-25 21:10:11.291371 | Database updated. | 14 | OMERO5.1DEV |
18 | 15 | OMERO5.1DEV | -52 | 2014-11-25 21:11:35.011355 | DB check DBEnumCheck: done for Bio-Formats revision e88645d | 15 | OMERO5.1DEV |
19 | 15 | OMERO5.1DEV | -52 | 2014-12-03 11:30:26.547317 | DB check DBEnumCheck: done for Bio-Formats revision 9193b2e | 15 | OMERO5.1DEV |
20 | 16 | OMERO5.1DEV | -52 | 2014-12-15 15:37:22.868178 | Database updated. | 15 | OMERO5.1DEV |
21 | 17 | OMERO5.1DEV | -52 | 2014-12-15 15:37:53.515159 | Database updated. | 16 | OMERO5.1DEV |
22 | 17 | OMERO5.1DEV | -52 | 2014-12-15 15:39:00.235922 | DB check DBEnumCheck: done for Bio-Formats revision 7cb0e07 | 17 | OMERO5.1DEV |
23 | 17 | OMERO5.1DEV | -52 | 2015-01-09 15:49:12.478168 | DB check DBEnumCheck: done for Bio-Formats revision b97e94a | 17 | OMERO5.1DEV |
24 | 17 | OMERO5.1DEV | -52 | 2015-01-13 14:15:00.499317 | DB check DBEnumCheck: done for Bio-Formats revision bb93308 | 17 | OMERO5.1DEV |
25 | 18 | OMERO5.1DEV | -52 | 2015-01-22 12:12:29.83363 | Database updated. | 17 | OMERO5.1DEV |
26 | 18 | OMERO5.1DEV | -52 | 2015-01-22 12:13:14.421085 | DB check DBEnumCheck: done for Bio-Formats revision 647e519 | 18 | OMERO5.1DEV |
27 | 18 | OMERO5.1DEV | -52 | 2015-01-28 14:09:21.937303 | DB check DBEnumCheck: done for Bio-Formats revision 8e41f8a | 18 | OMERO5.1DEV |
29 | 20 | OMERO5.1DEV | -52 | 2015-02-17 10:50:23.251842 | Database updated. | 19 | OMERO5.1DEV |
30 | 20 | OMERO5.1DEV | -52 | 2015-02-17 10:51:51.283311 | DB check DBEnumCheck: done for Bio-Formats revision ae60850 | 20 | OMERO5.1DEV |
31 | 20 | OMERO5.1DEV | -52 | 2015-02-25 14:53:28.596733 | DB check DBEnumCheck: done for Bio-Formats revision 2a2b0dd | 20 | OMERO5.1DEV |
32 | 0 | OMERO5.1 | -52 | 2015-03-05 15:03:28.741529 | Database updated. | 20 | OMERO5.1DEV |
33 | 0 | OMERO5.1 | -52 | 2015-03-05 15:05:44.209495 | DB check DBEnumCheck: done for Bio-Formats revision 964fd88 | 0 | OMERO5.1 |
34 | 0 | OMERO5.1 | -52 | 2015-03-12 15:08:06.467993 | DB check DBEnumCheck: done for Bio-Formats revision 949d2db | 0 | OMERO5.1 |
35 | 1 | OMERO5.1 | -52 | 2015-03-26 21:13:26.244293 | Database updated. | 0 | OMERO5.1 |
36 | 1 | OMERO5.1 | -52 | 2015-03-26 21:14:11.021661 | DB check DBEnumCheck: done for Bio-Formats revision a1d0e604285369de157183034bf3ec74a3ec9584 | 1 | OMERO5.1 |
37 | 1 | OMERO5.1 | -52 | 2015-04-14 15:03:10.957443 | DB check DBEnumCheck: done for Bio-Formats revision a8216cbe4f75bd46a166fed954f04bd0d7c7ccaa | 1 | OMERO5.1 |
38 | 1 | OMERO5.1 | -52 | 2015-04-15 13:54:57.570084 | DB check DBEnumCheck: done for Bio-Formats revision 72dfe5a4ec27c14dd7a55f2e944f6fcb458cb5a4 | 1 | OMERO5.1 |
39 | 1 | OMERO5.1 | -52 | 2015-04-22 12:17:16.070018 | DB check DBEnumCheck: done for Bio-Formats revision ef1979146c80fbc8c7771946f6ee5031c1bb14c2 | 1 | OMERO5.1 |
40 | 1 | OMERO5.1 | -52 | 2015-05-11 13:50:03.815101 | DB check DBEnumCheck: done for Bio-Formats revision 6aef02f8d1927955215f1ce2a1a7d34891e4c107 | 1 | OMERO5.1 |
41 | 1 | OMERO5.1 | -52 | 2015-05-13 21:16:31.459126 | DB check DBEnumCheck: done for Bio-Formats revision e847f4fd24af3d30fe5dc4934ed46ba000e49273 | 1 | OMERO5.1 |
42 | 1 | OMERO5.1 | -52 | 2015-06-18 22:59:30.891794 | DB check DBEnumCheck: done for Bio-Formats revision cc0de231bfed0e0a7c4ff24d6bc7fa38ad68d092 | 1 | OMERO5.1 |
43 | 1 | OMERO5.1 | -52 | 2015-06-18 22:59:31.004917 | DB check DBUnicodeUnitsCheck: done | 1 | OMERO5.1 |
44 | 1 | OMERO5.1 | -52 | 2015-06-22 11:10:38.747123 | DB check DBEnumCheck: done for Bio-Formats revision 4bf1883ff608294ae28eb0861e805157677c8147 | 1 | OMERO5.1 |
45 | 1 | OMERO5.1 | -52 | 2015-06-30 11:40:30.619027 | DB check DBEnumCheck: done for Bio-Formats revision 289e52267f2eef87741350e2eec51d3dab65ae8e | 1 | OMERO5.1 |
46 | 1 | OMERO5.1 | -52 | 2015-07-23 12:25:07.149011 | DB check DBEnumCheck: done for Bio-Formats revision 4aaab80c4593086f243fda9931b7db32091f00b1 | 1 | OMERO5.1 |
47 | 1 | OMERO5.1 | -52 | 2015-07-23 21:48:01.960723 | DB check DBEnumCheck: done for Bio-Formats revision 8402f9bc8b80081bc2967927632dbb507efb61e6 | 1 | OMERO5.1 |
48 | 1 | OMERO5.1 | -52 | 2015-07-28 12:22:13.125809 | DB check DBEnumCheck: done for Bio-Formats revision 9f23406124e792df03d94f37f6c694057b85ddcb | 1 | OMERO5.1 |
50 | 1 | OMERO5.1 | -52 | 2015-08-24 13:57:16.502384 | DB check DBEnumCheck: done for Bio-Formats revision 80e9b4f449434db1d1cd20f7ec1b2194679b5d1a | 1 | OMERO5.1 |
49 | 1 | OMERO5.1 | -52 | 2015-09-01 12:59:57.746384 | DB check DBEnumCheck: done for Bio-Formats revision ec25a9cdcade57643a187c31aab84032d209baaf | 1 | OMERO5.1 |
51 | 1 | OMERO5.1 | -52 | 2015-09-01 12:59:57.74682 | DB check DBEnumCheck: done for Bio-Formats revision ec25a9cdcade57643a187c31aab84032d209baaf | 1 | OMERO5.1 |
52 | 1 | OMERO5.1 | -52 | 2015-09-15 21:37:56.025451 | DB check DBEnumCheck: done for Bio-Formats revision 6673a32fe951bbf0235ba9faf14dbe6600169f49 | 1 | OMERO5.1 |
53 | 1 | OMERO5.1 | -52 | 2015-09-18 13:05:44.484388 | DB check DBEnumCheck: done for Bio-Formats revision 05840624ab3d1d1dca14d1ccfebabcb61c42ec27 | 1 | OMERO5.1 |
54 | 1 | OMERO5.1 | -52 | 2015-09-21 14:00:38.97495 | DB check DBEnumCheck: done for Bio-Formats revision 4c07b4155594eacdc76024e57003180909273b58 | 1 | OMERO5.1 |
55 | 0 | OMERO5.2DEV | -52 | 2015-10-14 11:46:18.760541 | Database updated. | 1 | OMERO5.1 |
56 | 0 | OMERO5.2DEV | -52 | 2015-10-14 11:46:49.920182 | DB check DBEnumCheck: done for Bio-Formats revision 94a1a0d8a2f76d1e6d6c312776d17a79db0212cf | 0 | OMERO5.2DEV |
57 | 0 | OMERO5.2DEV | -52 | 2015-10-21 11:26:56.658234 | DB check DBEnumCheck: done for Bio-Formats revision 0aa39ce83049ff2fbd9db8cf12d1b9dff95317d7 | 0 | OMERO5.2DEV |
58 | 0 | OMERO5.2 | -52 | 2015-10-23 14:08:32.029159 | Database updated. | 0 | OMERO5.2DEV |
59 | 0 | OMERO5.2 | -52 | 2015-10-23 14:10:56.893531 | DB check DBEnumCheck: done for Bio-Formats revision 6a2377c77fae7353941c62a7cf0bc8564159bfb1 | 0 | OMERO5.2 |
60 | 0 | OMERO5.2 | -52 | 2015-12-15 12:15:00.731179 | DB check DBEnumCheck: done for Bio-Formats revision 11e42dc1164c326bfb10ae8af475528b134c0ef7 | 0 | OMERO5.2 |
61 | 0 | OMERO5.2 | -52 | 2016-01-25 12:30:43.285146 | DB check DBEnumCheck: done for Bio-Formats revision 8ef015dc4b2a5f2035e49486c9da9a9f301b53cc | 0 | OMERO5.2 |
62 | 0 | OMERO5.2 | -52 | 2016-02-19 10:39:18.068476 | DB check DBEnumCheck: done for Bio-Formats revision 9eb8da31c1f01989f439963b9cc215b4398bedd8 | 0 | OMERO5.2 |
(62 rows)
With that history, DB upgrade failed:
psql -h localhost -U omero omero < sql/psql/OMERO5.3DEV__5/OMERO5.2__0.sql
...
DROP TRIGGER
ERROR: trigger "objective_annotation_link_event_trigger_insert" for table "objectiveannotationlink" does not exist
ERROR: current transaction is aborted, commands ignored until end of transaction block
...
Workaround was to comment out failing lines:
$ git diff
diff --git a/components/tools/OmeroPy/scripts b/components/tools/OmeroPy/scripts
index 6c4218e..4ae1da4 160000
--- a/components/tools/OmeroPy/scripts
+++ b/components/tools/OmeroPy/scripts
@@ -1 +1 @@
-Subproject commit 6c4218efccb0d271c724e8ce5f89b167bd99ea55
+Subproject commit 4ae1da419b714270986f346219f2d9d8e48d02d4
diff --git a/sql/psql/OMERO5.3DEV__5/OMERO5.2__0.sql b/sql/psql/OMERO5.3DEV__5/OMERO5.2__0.sql
index 5a3dad7..fe79546 100644
--- a/sql/psql/OMERO5.3DEV__5/OMERO5.2__0.sql
+++ b/sql/psql/OMERO5.3DEV__5/OMERO5.2__0.sql
@@ -693,9 +693,9 @@ DROP TRIGGER channel_annotation_link_event_trigger_insert ON channelannotationli
DROP TRIGGER dataset_annotation_link_event_trigger ON datasetannotationlink;
DROP TRIGGER dataset_annotation_link_event_trigger_insert ON datasetannotationlink;
DROP TRIGGER detector_annotation_link_event_trigger ON detectorannotationlink;
-DROP TRIGGER detector_annotation_link_event_trigger_insert ON detectorannotationlink;
+-- DROP TRIGGER detector_annotation_link_event_trigger_insert ON detectorannotationlink;
DROP TRIGGER dichroic_annotation_link_event_trigger ON dichroicannotationlink;
-DROP TRIGGER dichroic_annotation_link_event_trigger_insert ON dichroicannotationlink;
+-- DROP TRIGGER dichroic_annotation_link_event_trigger_insert ON dichroicannotationlink;
DROP TRIGGER experimenter_annotation_link_event_trigger ON experimenterannotationlink;
DROP TRIGGER experimenter_annotation_link_event_trigger_insert ON experimenterannotationlink;
DROP TRIGGER experimentergroup_annotation_link_event_trigger ON experimentergroupannotationlink;
@@ -703,23 +703,23 @@ DROP TRIGGER experimentergroup_annotation_link_event_trigger_insert ON experimen
DROP TRIGGER fileset_annotation_link_event_trigger ON filesetannotationlink;
DROP TRIGGER fileset_annotation_link_event_trigger_insert ON filesetannotationlink;
DROP TRIGGER filter_annotation_link_event_trigger ON filterannotationlink;
-DROP TRIGGER filter_annotation_link_event_trigger_insert ON filterannotationlink;
+-- DROP TRIGGER filter_annotation_link_event_trigger_insert ON filterannotationlink;
DROP TRIGGER folder_annotation_link_event_trigger ON folderannotationlink;
DROP TRIGGER folder_annotation_link_event_trigger_insert ON folderannotationlink;
DROP TRIGGER image_annotation_link_event_trigger ON imageannotationlink;
DROP TRIGGER image_annotation_link_event_trigger_insert ON imageannotationlink;
DROP TRIGGER instrument_annotation_link_event_trigger ON instrumentannotationlink;
-DROP TRIGGER instrument_annotation_link_event_trigger_insert ON instrumentannotationlink;
+-- DROP TRIGGER instrument_annotation_link_event_trigger_insert ON instrumentannotationlink;
DROP TRIGGER lightpath_annotation_link_event_trigger ON lightpathannotationlink;
-DROP TRIGGER lightpath_annotation_link_event_trigger_insert ON lightpathannotationlink;
+-- DROP TRIGGER lightpath_annotation_link_event_trigger_insert ON lightpathannotationlink;
DROP TRIGGER lightsource_annotation_link_event_trigger ON lightsourceannotationlink;
-DROP TRIGGER lightsource_annotation_link_event_trigger_insert ON lightsourceannotationlink;
+-- DROP TRIGGER lightsource_annotation_link_event_trigger_insert ON lightsourceannotationlink;
DROP TRIGGER namespace_annotation_link_event_trigger ON namespaceannotationlink;
DROP TRIGGER namespace_annotation_link_event_trigger_insert ON namespaceannotationlink;
DROP TRIGGER node_annotation_link_event_trigger ON nodeannotationlink;
DROP TRIGGER node_annotation_link_event_trigger_insert ON nodeannotationlink;
DROP TRIGGER objective_annotation_link_event_trigger ON objectiveannotationlink;
-DROP TRIGGER objective_annotation_link_event_trigger_insert ON objectiveannotationlink;
+-- DROP TRIGGER objective_annotation_link_event_trigger_insert ON objectiveannotationlink;
DROP TRIGGER originalfile_annotation_link_event_trigger ON originalfileannotationlink;
DROP TRIGGER originalfile_annotation_link_event_trigger_insert ON originalfileannotationlink;
DROP TRIGGER planeinfo_annotation_link_event_trigger ON planeinfoannotationlink;
@@ -739,7 +739,7 @@ DROP TRIGGER screen_annotation_link_event_trigger_insert ON screenannotationlink
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment