From f259b4b4c14bf6b32571883e097d3588b73c7492 Mon Sep 17 00:00:00 2001 From: Mark Carroll Date: Wed, 5 Oct 2016 15:35:20 +0100 Subject: [PATCH 1/9] generate named model objects with "text"-type name attribute used to be "string" --- components/dsl/src/ome/dsl/SaxReader.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/dsl/src/ome/dsl/SaxReader.java b/components/dsl/src/ome/dsl/SaxReader.java index 47116bb4745..5e47b63f105 100644 --- a/components/dsl/src/ome/dsl/SaxReader.java +++ b/components/dsl/src/ome/dsl/SaxReader.java @@ -1,7 +1,7 @@ /* * ome.dsl.SaxReader * -* Copyright 2006 University of Dundee. All rights reserved. +* Copyright 2006-2016 University of Dundee. All rights reserved. * Use is subject to license terms supplied in LICENSE.txt */ @@ -268,7 +268,7 @@ public List process() { if (named != null && named.booleanValue()) { Properties p = new Properties(); p.setProperty("name", "name"); - p.setProperty("type", "string"); + p.setProperty("type", "text"); RequiredField r = new RequiredField(namedOrDescribed, p); namedOrDescribed.getProperties().add(r); } From f7a6cc8fa3c17d9ca1b1d6c2f50ac29e41bf9927 Mon Sep 17 00:00:00 2001 From: Mark Carroll Date: Wed, 5 Oct 2016 15:36:31 +0100 Subject: [PATCH 2/9] adjust various OMERO model object string properties to "text" --- .../model/resources/mappings/acquisition.ome.xml | 2 +- .../model/resources/mappings/annotations.ome.xml | 6 ++---- .../model/resources/mappings/containers.ome.xml | 2 +- components/model/resources/mappings/display.ome.xml | 2 +- components/model/resources/mappings/jobs.ome.xml | 6 ++---- components/model/resources/mappings/meta.ome.xml | 2 +- components/model/resources/mappings/roi.ome.xml | 2 +- components/model/resources/mappings/screen.ome.xml | 12 +++++------- 8 files changed, 14 insertions(+), 20 deletions(-) diff --git a/components/model/resources/mappings/acquisition.ome.xml b/components/model/resources/mappings/acquisition.ome.xml index 58c50495b07..79ed29b112f 100644 --- a/components/model/resources/mappings/acquisition.ome.xml +++ b/components/model/resources/mappings/acquisition.ome.xml @@ -198,7 +198,7 @@ - + diff --git a/components/model/resources/mappings/annotations.ome.xml b/components/model/resources/mappings/annotations.ome.xml index 8baa1073cb3..786b6fed77c 100644 --- a/components/model/resources/mappings/annotations.ome.xml +++ b/components/model/resources/mappings/annotations.ome.xml @@ -2,8 +2,6 @@ - - + + diff --git a/components/model/resources/mappings/containers.ome.xml b/components/model/resources/mappings/containers.ome.xml index 46d4f00e02f..57bf8621580 100644 --- a/components/model/resources/mappings/containers.ome.xml +++ b/components/model/resources/mappings/containers.ome.xml @@ -2,7 +2,7 @@ - - + + diff --git a/components/model/resources/mappings/meta.ome.xml b/components/model/resources/mappings/meta.ome.xml index be60bfc915b..3e65f5fde2d 100644 --- a/components/model/resources/mappings/meta.ome.xml +++ b/components/model/resources/mappings/meta.ome.xml @@ -172,7 +172,7 @@ - + diff --git a/components/model/resources/mappings/roi.ome.xml b/components/model/resources/mappings/roi.ome.xml index a5c5ab3fc14..25e13fe4817 100644 --- a/components/model/resources/mappings/roi.ome.xml +++ b/components/model/resources/mappings/roi.ome.xml @@ -11,7 +11,7 @@ - + diff --git a/components/model/resources/mappings/screen.ome.xml b/components/model/resources/mappings/screen.ome.xml index c00b36fc683..b194c203c26 100644 --- a/components/model/resources/mappings/screen.ome.xml +++ b/components/model/resources/mappings/screen.ome.xml @@ -2,9 +2,7 @@ - + From f2b29b73b1e2a34e4d386d83bf8cfa2a088e2594 Mon Sep 17 00:00:00 2001 From: Mark Carroll Date: Thu, 6 Oct 2016 11:09:47 +0100 Subject: [PATCH 3/9] move SQL scripts to new patch 13 --- .../{OMERO5.3DEV__12 => OMERO5.3DEV__13}/OMERO5.2__0-precheck.sql | 0 sql/psql/{OMERO5.3DEV__12 => OMERO5.3DEV__13}/OMERO5.2__0.sql | 0 .../{OMERO5.3DEV__12 => OMERO5.3DEV__13}/delete-ns-orphans.sql | 0 sql/psql/{OMERO5.3DEV__12 => OMERO5.3DEV__13}/psql-footer.sql | 0 sql/psql/{OMERO5.3DEV__12 => OMERO5.3DEV__13}/psql-header.sql | 0 sql/psql/{OMERO5.3DEV__12 => OMERO5.3DEV__13}/schema.sql | 0 sql/psql/{OMERO5.3DEV__12 => OMERO5.3DEV__13}/views.sql | 0 7 files changed, 0 insertions(+), 0 deletions(-) rename sql/psql/{OMERO5.3DEV__12 => OMERO5.3DEV__13}/OMERO5.2__0-precheck.sql (100%) rename sql/psql/{OMERO5.3DEV__12 => OMERO5.3DEV__13}/OMERO5.2__0.sql (100%) rename sql/psql/{OMERO5.3DEV__12 => OMERO5.3DEV__13}/delete-ns-orphans.sql (100%) rename sql/psql/{OMERO5.3DEV__12 => OMERO5.3DEV__13}/psql-footer.sql (100%) rename sql/psql/{OMERO5.3DEV__12 => OMERO5.3DEV__13}/psql-header.sql (100%) rename sql/psql/{OMERO5.3DEV__12 => OMERO5.3DEV__13}/schema.sql (100%) rename sql/psql/{OMERO5.3DEV__12 => OMERO5.3DEV__13}/views.sql (100%) diff --git a/sql/psql/OMERO5.3DEV__12/OMERO5.2__0-precheck.sql b/sql/psql/OMERO5.3DEV__13/OMERO5.2__0-precheck.sql similarity index 100% rename from sql/psql/OMERO5.3DEV__12/OMERO5.2__0-precheck.sql rename to sql/psql/OMERO5.3DEV__13/OMERO5.2__0-precheck.sql diff --git a/sql/psql/OMERO5.3DEV__12/OMERO5.2__0.sql b/sql/psql/OMERO5.3DEV__13/OMERO5.2__0.sql similarity index 100% rename from sql/psql/OMERO5.3DEV__12/OMERO5.2__0.sql rename to sql/psql/OMERO5.3DEV__13/OMERO5.2__0.sql diff --git a/sql/psql/OMERO5.3DEV__12/delete-ns-orphans.sql b/sql/psql/OMERO5.3DEV__13/delete-ns-orphans.sql similarity index 100% rename from sql/psql/OMERO5.3DEV__12/delete-ns-orphans.sql rename to sql/psql/OMERO5.3DEV__13/delete-ns-orphans.sql diff --git a/sql/psql/OMERO5.3DEV__12/psql-footer.sql b/sql/psql/OMERO5.3DEV__13/psql-footer.sql similarity index 100% rename from sql/psql/OMERO5.3DEV__12/psql-footer.sql rename to sql/psql/OMERO5.3DEV__13/psql-footer.sql diff --git a/sql/psql/OMERO5.3DEV__12/psql-header.sql b/sql/psql/OMERO5.3DEV__13/psql-header.sql similarity index 100% rename from sql/psql/OMERO5.3DEV__12/psql-header.sql rename to sql/psql/OMERO5.3DEV__13/psql-header.sql diff --git a/sql/psql/OMERO5.3DEV__12/schema.sql b/sql/psql/OMERO5.3DEV__13/schema.sql similarity index 100% rename from sql/psql/OMERO5.3DEV__12/schema.sql rename to sql/psql/OMERO5.3DEV__13/schema.sql diff --git a/sql/psql/OMERO5.3DEV__12/views.sql b/sql/psql/OMERO5.3DEV__13/views.sql similarity index 100% rename from sql/psql/OMERO5.3DEV__12/views.sql rename to sql/psql/OMERO5.3DEV__13/views.sql From 7cc94ae217c1605e9a91448a0a77ee74baf12c86 Mon Sep 17 00:00:00 2001 From: Mark Carroll Date: Thu, 6 Oct 2016 11:13:48 +0100 Subject: [PATCH 4/9] prepare database scripts for new patch 13 --- .../OMERO5.3DEV__13/OMERO5.2__0-precheck.sql | 4 +- sql/psql/OMERO5.3DEV__13/OMERO5.2__0.sql | 12 ++-- sql/psql/OMERO5.3DEV__13/OMERO5.3DEV__12.sql | 72 +++++++++++++++++++ 3 files changed, 82 insertions(+), 6 deletions(-) create mode 100644 sql/psql/OMERO5.3DEV__13/OMERO5.3DEV__12.sql diff --git a/sql/psql/OMERO5.3DEV__13/OMERO5.2__0-precheck.sql b/sql/psql/OMERO5.3DEV__13/OMERO5.2__0-precheck.sql index 995ec02077f..a50eb521a3c 100644 --- a/sql/psql/OMERO5.3DEV__13/OMERO5.2__0-precheck.sql +++ b/sql/psql/OMERO5.3DEV__13/OMERO5.2__0-precheck.sql @@ -17,7 +17,7 @@ -- --- ---- OMERO5 readiness check for upgrade from OMERO5.2__0 to OMERO5.3DEV__12. +--- OMERO5 readiness check for upgrade from OMERO5.2__0 to OMERO5.3DEV__13. --- BEGIN; @@ -245,6 +245,6 @@ DROP FUNCTION parse_transform(TEXT); -- FINISHED -- -SELECT CHR(10)||CHR(10)||CHR(10)||'YOUR DATABASE IS READY FOR UPGRADE TO VERSION OMERO5.3DEV__12'||CHR(10)||CHR(10)||CHR(10) AS Status; +SELECT CHR(10)||CHR(10)||CHR(10)||'YOUR DATABASE IS READY FOR UPGRADE TO VERSION OMERO5.3DEV__13'||CHR(10)||CHR(10)||CHR(10) AS Status; ROLLBACK; diff --git a/sql/psql/OMERO5.3DEV__13/OMERO5.2__0.sql b/sql/psql/OMERO5.3DEV__13/OMERO5.2__0.sql index 0dfa58a5bb0..0acf5870d49 100644 --- a/sql/psql/OMERO5.3DEV__13/OMERO5.2__0.sql +++ b/sql/psql/OMERO5.3DEV__13/OMERO5.2__0.sql @@ -17,7 +17,7 @@ -- --- ---- OMERO5 development release upgrade from OMERO5.2__0 to OMERO5.3DEV__12. +--- OMERO5 development release upgrade from OMERO5.2__0 to OMERO5.3DEV__13. --- BEGIN; @@ -95,7 +95,7 @@ DROP FUNCTION db_pretty_version(INTEGER); -- INSERT INTO dbpatch (currentVersion, currentPatch, previousVersion, previousPatch) - VALUES ('OMERO5.3DEV', 12, 'OMERO5.2', 0); + VALUES ('OMERO5.3DEV', 13, 'OMERO5.2', 0); -- ... up to patch 0: @@ -1976,6 +1976,10 @@ CREATE OR REPLACE FUNCTION filesetjoblink_parent_index_move() RETURNS trigger DELETE FROM format WHERE id NOT IN (SELECT DISTINCT format FROM image WHERE format IS NOT NULL) AND external_id IS NULL; +-- ... up to patch 13: + +-- TODO + -- -- FINISHED @@ -1983,10 +1987,10 @@ DELETE FROM format WHERE id NOT IN (SELECT DISTINCT format FROM image WHERE form UPDATE dbpatch SET message = 'Database updated.', finished = clock_timestamp() WHERE currentVersion = 'OMERO5.3DEV' AND - currentPatch = 12 AND + currentPatch = 13 AND previousVersion = 'OMERO5.2' AND previousPatch = 0; -SELECT CHR(10)||CHR(10)||CHR(10)||'YOU HAVE SUCCESSFULLY UPGRADED YOUR DATABASE TO VERSION OMERO5.3DEV__12'||CHR(10)||CHR(10)||CHR(10) AS Status; +SELECT CHR(10)||CHR(10)||CHR(10)||'YOU HAVE SUCCESSFULLY UPGRADED YOUR DATABASE TO VERSION OMERO5.3DEV__13'||CHR(10)||CHR(10)||CHR(10) AS Status; COMMIT; diff --git a/sql/psql/OMERO5.3DEV__13/OMERO5.3DEV__12.sql b/sql/psql/OMERO5.3DEV__13/OMERO5.3DEV__12.sql new file mode 100644 index 00000000000..0e6bc9e5e25 --- /dev/null +++ b/sql/psql/OMERO5.3DEV__13/OMERO5.3DEV__12.sql @@ -0,0 +1,72 @@ +-- Copyright (C) 2012-4 Glencoe Software, Inc. All rights reserved. +-- Use is subject to license terms supplied in LICENSE.txt +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along +-- with this program; if not, write to the Free Software Foundation, Inc., +-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +-- + +--- +--- OMERO5 development release upgrade from OMERO5.3DEV__12 to OMERO5.3DEV__13. +--- + +BEGIN; + + +-- +-- check OMERO database version +-- + +CREATE OR REPLACE FUNCTION omero_assert_db_version(expected_version VARCHAR, expected_patch INTEGER) RETURNS void AS $$ + +DECLARE + current_version VARCHAR; + current_patch INTEGER; + +BEGIN + SELECT currentversion, currentpatch INTO STRICT current_version, current_patch + FROM dbpatch ORDER BY id DESC LIMIT 1; + + IF current_version <> expected_version OR current_patch <> expected_patch THEN + RAISE EXCEPTION 'wrong OMERO database version for this upgrade script'; + END IF; + +END;$$ LANGUAGE plpgsql; + +SELECT omero_assert_db_version('OMERO5.3DEV', 12); +DROP FUNCTION omero_assert_db_version(varchar, int); + + +-- +-- Actual upgrade +-- + +INSERT INTO dbpatch (currentVersion, currentPatch, previousVersion, previousPatch) + VALUES ('OMERO5.3DEV', 13, 'OMERO5.3DEV', 12); + +-- TODO + + +-- +-- FINISHED +-- + +UPDATE dbpatch SET message = 'Database updated.', finished = clock_timestamp() + WHERE currentVersion = 'OMERO5.3DEV' AND + currentPatch = 13 AND + previousVersion = 'OMERO5.3DEV' AND + previousPatch = 12; + +SELECT CHR(10)||CHR(10)||CHR(10)||'YOU HAVE SUCCESSFULLY UPGRADED YOUR DATABASE TO VERSION OMERO5.3DEV__13'||CHR(10)||CHR(10)||CHR(10) AS Status; + +COMMIT; From 550f07a0142ec70f212bac0cdf855d868527cac5 Mon Sep 17 00:00:00 2001 From: Mark Carroll Date: Thu, 6 Oct 2016 11:15:07 +0100 Subject: [PATCH 5/9] add actual upgrade DDL --- sql/psql/OMERO5.3DEV__13/OMERO5.2__0.sql | 22 +++++++++++++++++++- sql/psql/OMERO5.3DEV__13/OMERO5.3DEV__12.sql | 22 +++++++++++++++++++- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/sql/psql/OMERO5.3DEV__13/OMERO5.2__0.sql b/sql/psql/OMERO5.3DEV__13/OMERO5.2__0.sql index 0acf5870d49..1c30421b5d3 100644 --- a/sql/psql/OMERO5.3DEV__13/OMERO5.2__0.sql +++ b/sql/psql/OMERO5.3DEV__13/OMERO5.2__0.sql @@ -1978,7 +1978,27 @@ DELETE FROM format WHERE id NOT IN (SELECT DISTINCT format FROM image WHERE form -- ... up to patch 13: --- TODO +ALTER TABLE annotation ALTER COLUMN name TYPE TEXT; +ALTER TABLE annotation ALTER COLUMN ns TYPE TEXT; +ALTER TABLE dataset ALTER COLUMN name TYPE TEXT; +ALTER TABLE folder ALTER COLUMN name TYPE TEXT; +ALTER TABLE image ALTER COLUMN name TYPE TEXT; +ALTER TABLE importjob ALTER COLUMN imagename TYPE TEXT; +ALTER TABLE importjob ALTER COLUMN imagedescription TYPE TEXT; +ALTER TABLE logicalchannel ALTER COLUMN name TYPE TEXT; +ALTER TABLE namespace ALTER COLUMN name TYPE TEXT; +ALTER TABLE namespace ALTER COLUMN displayname TYPE TEXT; +ALTER TABLE originalfile ALTER COLUMN name TYPE TEXT; +ALTER TABLE plate ALTER COLUMN name TYPE TEXT; +ALTER TABLE plateacquisition ALTER COLUMN name TYPE TEXT; +ALTER TABLE project ALTER COLUMN name TYPE TEXT; +ALTER TABLE reagent ALTER COLUMN name TYPE TEXT; +ALTER TABLE renderingdef ALTER COLUMN name TYPE TEXT; +ALTER TABLE roi ALTER COLUMN name TYPE TEXT; +ALTER TABLE screen ALTER COLUMN name TYPE TEXT; +ALTER TABLE screen ALTER COLUMN protocoldescription TYPE TEXT; +ALTER TABLE screen ALTER COLUMN reagentsetdescription TYPE TEXT; +ALTER TABLE stagelabel ALTER COLUMN name TYPE TEXT; -- diff --git a/sql/psql/OMERO5.3DEV__13/OMERO5.3DEV__12.sql b/sql/psql/OMERO5.3DEV__13/OMERO5.3DEV__12.sql index 0e6bc9e5e25..544024d260e 100644 --- a/sql/psql/OMERO5.3DEV__13/OMERO5.3DEV__12.sql +++ b/sql/psql/OMERO5.3DEV__13/OMERO5.3DEV__12.sql @@ -54,7 +54,27 @@ DROP FUNCTION omero_assert_db_version(varchar, int); INSERT INTO dbpatch (currentVersion, currentPatch, previousVersion, previousPatch) VALUES ('OMERO5.3DEV', 13, 'OMERO5.3DEV', 12); --- TODO +ALTER TABLE annotation ALTER COLUMN name TYPE TEXT; +ALTER TABLE annotation ALTER COLUMN ns TYPE TEXT; +ALTER TABLE dataset ALTER COLUMN name TYPE TEXT; +ALTER TABLE folder ALTER COLUMN name TYPE TEXT; +ALTER TABLE image ALTER COLUMN name TYPE TEXT; +ALTER TABLE importjob ALTER COLUMN imagename TYPE TEXT; +ALTER TABLE importjob ALTER COLUMN imagedescription TYPE TEXT; +ALTER TABLE logicalchannel ALTER COLUMN name TYPE TEXT; +ALTER TABLE namespace ALTER COLUMN name TYPE TEXT; +ALTER TABLE namespace ALTER COLUMN displayname TYPE TEXT; +ALTER TABLE originalfile ALTER COLUMN name TYPE TEXT; +ALTER TABLE plate ALTER COLUMN name TYPE TEXT; +ALTER TABLE plateacquisition ALTER COLUMN name TYPE TEXT; +ALTER TABLE project ALTER COLUMN name TYPE TEXT; +ALTER TABLE reagent ALTER COLUMN name TYPE TEXT; +ALTER TABLE renderingdef ALTER COLUMN name TYPE TEXT; +ALTER TABLE roi ALTER COLUMN name TYPE TEXT; +ALTER TABLE screen ALTER COLUMN name TYPE TEXT; +ALTER TABLE screen ALTER COLUMN protocoldescription TYPE TEXT; +ALTER TABLE screen ALTER COLUMN reagentsetdescription TYPE TEXT; +ALTER TABLE stagelabel ALTER COLUMN name TYPE TEXT; -- From ce7fb1299ab16aff9d90997d305fe40ad3e1ae1a Mon Sep 17 00:00:00 2001 From: Mark Carroll Date: Thu, 6 Oct 2016 11:16:43 +0100 Subject: [PATCH 6/9] generate new schema for patch 13 --- etc/omero.properties | 2 +- sql/psql/OMERO5.3DEV__13/psql-footer.sql | 4 +-- sql/psql/OMERO5.3DEV__13/schema.sql | 42 ++++++++++++------------ 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/etc/omero.properties b/etc/omero.properties index 914c4c7f5c3..11e4a0d1de1 100644 --- a/etc/omero.properties +++ b/etc/omero.properties @@ -44,7 +44,7 @@ omero.db.version=OMERO5.3DEV # server that is is being used with. Any changes by # developers to the database schema will result in # a bump to this value. -omero.db.patch=12 +omero.db.patch=13 # The string that will be used as the base for LSIDs # in all exported OME objects including OME-XML and diff --git a/sql/psql/OMERO5.3DEV__13/psql-footer.sql b/sql/psql/OMERO5.3DEV__13/psql-footer.sql index 8189f12f9a1..a32dbb8fa19 100644 --- a/sql/psql/OMERO5.3DEV__13/psql-footer.sql +++ b/sql/psql/OMERO5.3DEV__13/psql-footer.sql @@ -2042,7 +2042,7 @@ alter table dbpatch alter message set default 'Updating'; -- running so that if anything goes wrong, we'll have some record. -- insert into dbpatch (currentVersion, currentPatch, previousVersion, previousPatch, message) - values ('OMERO5.3DEV', 12, 'OMERO5.3DEV', 0, 'Initializing'); + values ('OMERO5.3DEV', 13, 'OMERO5.3DEV', 0, 'Initializing'); -- -- Temporarily make event columns nullable; restored below. @@ -3162,7 +3162,7 @@ CREATE TRIGGER preserve_folder_tree -- Here we have finished initializing this database. update dbpatch set message = 'Database ready.', finished = clock_timestamp() where currentVersion = 'OMERO5.3DEV' and - currentPatch = 12 and + currentPatch = 13 and previousVersion = 'OMERO5.3DEV' and previousPatch = 0; diff --git a/sql/psql/OMERO5.3DEV__13/schema.sql b/sql/psql/OMERO5.3DEV__13/schema.sql index 37ee1f581b6..b1fc1677235 100644 --- a/sql/psql/OMERO5.3DEV__13/schema.sql +++ b/sql/psql/OMERO5.3DEV__13/schema.sql @@ -30,8 +30,8 @@ id int8 not null, description text, permissions int8 not null, - name varchar(255), - ns varchar(255), + name text, + ns text, version int4, boolValue bool, textValue text, @@ -558,7 +558,7 @@ id int8 not null, description text, permissions int8 not null, - name varchar(255) not null, + name text not null, version int4, creation_id int8 not null, external_id int8 unique, @@ -1040,7 +1040,7 @@ id int8 not null, description text, permissions int8 not null, - name varchar(255) not null, + name text not null, version int4, creation_id int8 not null, external_id int8 unique, @@ -1145,7 +1145,7 @@ archived bool, description text, permissions int8 not null, - name varchar(255) not null, + name text not null, partial bool, series nonnegative_int, version int4, @@ -1214,8 +1214,8 @@ );; create table importjob ( - imageDescription varchar(255) not null, - imageName varchar(255) not null, + imageDescription text not null, + imageName text not null, job_id int8 not null, primary key (job_id) );; @@ -1470,7 +1470,7 @@ excitationWaveUnit UnitsLength, excitationWave float8, fluor varchar(255), - name varchar(255), + name text, ndFilter float8, pinHoleSizeUnit UnitsLength, pinHoleSize float8, @@ -1568,10 +1568,10 @@ description text, permissions int8 not null, display bool, - displayName varchar(255), + displayName text, keywords text[], multivalued bool, - name varchar(255) not null, + name text not null, version int4, external_id int8 unique, primary key (id) @@ -1684,7 +1684,7 @@ hash varchar(255), mimetype varchar(255), mtime timestamp, - name varchar(255) not null, + name text not null, path text not null, "size" int8, version int4, @@ -1870,7 +1870,7 @@ description text, permissions int8 not null, externalIdentifier varchar(255), - name varchar(255) not null, + name text not null, rowNamingConvention varchar(255), "rows" int4, status varchar(255), @@ -1893,7 +1893,7 @@ permissions int8 not null, endTime timestamp, maximumFieldCount int4, - name varchar(255), + name text, startTime timestamp, version int4, creation_id int8 not null, @@ -1939,7 +1939,7 @@ id int8 not null, description text, permissions int8 not null, - name varchar(255) not null, + name text not null, version int4, creation_id int8 not null, external_id int8 unique, @@ -2043,7 +2043,7 @@ id int8 not null, description text, permissions int8 not null, - name varchar(255), + name text, reagentIdentifier varchar(255), version int4, creation_id int8 not null, @@ -2076,7 +2076,7 @@ defaultT int4 not null, defaultZ int4 not null, permissions int8 not null, - name varchar(255), + name text, version int4, creation_id int8 not null, external_id int8 unique, @@ -2107,7 +2107,7 @@ id int8 not null, description text, permissions int8 not null, - name varchar(255), + name text, version int4, creation_id int8 not null, external_id int8 unique, @@ -2138,10 +2138,10 @@ id int8 not null, description text, permissions int8 not null, - name varchar(255) not null, - protocolDescription varchar(255), + name text not null, + protocolDescription text, protocolIdentifier varchar(255), - reagentSetDescription varchar(255), + reagentSetDescription text, reagentSetIdentifier varchar(255), type varchar(255), version int4, @@ -2309,7 +2309,7 @@ create table stagelabel ( id int8 not null, permissions int8 not null, - name varchar(255) not null, + name text not null, positionXUnit UnitsLength, positionX float8, positionYUnit UnitsLength, From 35ad489627ef794e96d323c1eebdd35bc9dba5f4 Mon Sep 17 00:00:00 2001 From: Mark Carroll Date: Fri, 7 Oct 2016 15:49:09 +0100 Subject: [PATCH 7/9] adjust more OMERO model object string properties to "text" --- components/model/resources/mappings/acquisition.ome.xml | 4 ++-- components/model/resources/mappings/screen.ome.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/model/resources/mappings/acquisition.ome.xml b/components/model/resources/mappings/acquisition.ome.xml index 79ed29b112f..ea188eb7ea5 100644 --- a/components/model/resources/mappings/acquisition.ome.xml +++ b/components/model/resources/mappings/acquisition.ome.xml @@ -104,7 +104,7 @@ - + - + @@ -65,7 +65,7 @@ - + From f8980149e4be6ed05bf935c9d68e58ec2919ef99 Mon Sep 17 00:00:00 2001 From: Mark Carroll Date: Fri, 7 Oct 2016 15:54:05 +0100 Subject: [PATCH 8/9] add actual upgrade DDL --- sql/psql/OMERO5.3DEV__13/OMERO5.2__0.sql | 4 ++++ sql/psql/OMERO5.3DEV__13/OMERO5.3DEV__12.sql | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/sql/psql/OMERO5.3DEV__13/OMERO5.2__0.sql b/sql/psql/OMERO5.3DEV__13/OMERO5.2__0.sql index 1c30421b5d3..23299015056 100644 --- a/sql/psql/OMERO5.3DEV__13/OMERO5.2__0.sql +++ b/sql/psql/OMERO5.3DEV__13/OMERO5.2__0.sql @@ -1980,6 +1980,7 @@ DELETE FROM format WHERE id NOT IN (SELECT DISTINCT format FROM image WHERE form ALTER TABLE annotation ALTER COLUMN name TYPE TEXT; ALTER TABLE annotation ALTER COLUMN ns TYPE TEXT; +ALTER TABLE channel ALTER COLUMN lookuptable TYPE TEXT; ALTER TABLE dataset ALTER COLUMN name TYPE TEXT; ALTER TABLE folder ALTER COLUMN name TYPE TEXT; ALTER TABLE image ALTER COLUMN name TYPE TEXT; @@ -1989,7 +1990,9 @@ ALTER TABLE logicalchannel ALTER COLUMN name TYPE TEXT; ALTER TABLE namespace ALTER COLUMN name TYPE TEXT; ALTER TABLE namespace ALTER COLUMN displayname TYPE TEXT; ALTER TABLE originalfile ALTER COLUMN name TYPE TEXT; +ALTER TABLE originalfile ALTER COLUMN hash TYPE TEXT; ALTER TABLE plate ALTER COLUMN name TYPE TEXT; +ALTER TABLE plate ALTER COLUMN status TYPE TEXT; ALTER TABLE plateacquisition ALTER COLUMN name TYPE TEXT; ALTER TABLE project ALTER COLUMN name TYPE TEXT; ALTER TABLE reagent ALTER COLUMN name TYPE TEXT; @@ -1999,6 +2002,7 @@ ALTER TABLE screen ALTER COLUMN name TYPE TEXT; ALTER TABLE screen ALTER COLUMN protocoldescription TYPE TEXT; ALTER TABLE screen ALTER COLUMN reagentsetdescription TYPE TEXT; ALTER TABLE stagelabel ALTER COLUMN name TYPE TEXT; +ALTER TABLE well ALTER COLUMN externaldescription TYPE TEXT; -- diff --git a/sql/psql/OMERO5.3DEV__13/OMERO5.3DEV__12.sql b/sql/psql/OMERO5.3DEV__13/OMERO5.3DEV__12.sql index 544024d260e..3372afc57b5 100644 --- a/sql/psql/OMERO5.3DEV__13/OMERO5.3DEV__12.sql +++ b/sql/psql/OMERO5.3DEV__13/OMERO5.3DEV__12.sql @@ -56,6 +56,7 @@ INSERT INTO dbpatch (currentVersion, currentPatch, previousVersion, previousPatc ALTER TABLE annotation ALTER COLUMN name TYPE TEXT; ALTER TABLE annotation ALTER COLUMN ns TYPE TEXT; +ALTER TABLE channel ALTER COLUMN lookuptable TYPE TEXT; ALTER TABLE dataset ALTER COLUMN name TYPE TEXT; ALTER TABLE folder ALTER COLUMN name TYPE TEXT; ALTER TABLE image ALTER COLUMN name TYPE TEXT; @@ -65,7 +66,9 @@ ALTER TABLE logicalchannel ALTER COLUMN name TYPE TEXT; ALTER TABLE namespace ALTER COLUMN name TYPE TEXT; ALTER TABLE namespace ALTER COLUMN displayname TYPE TEXT; ALTER TABLE originalfile ALTER COLUMN name TYPE TEXT; +ALTER TABLE originalfile ALTER COLUMN hash TYPE TEXT; ALTER TABLE plate ALTER COLUMN name TYPE TEXT; +ALTER TABLE plate ALTER COLUMN status TYPE TEXT; ALTER TABLE plateacquisition ALTER COLUMN name TYPE TEXT; ALTER TABLE project ALTER COLUMN name TYPE TEXT; ALTER TABLE reagent ALTER COLUMN name TYPE TEXT; @@ -75,6 +78,7 @@ ALTER TABLE screen ALTER COLUMN name TYPE TEXT; ALTER TABLE screen ALTER COLUMN protocoldescription TYPE TEXT; ALTER TABLE screen ALTER COLUMN reagentsetdescription TYPE TEXT; ALTER TABLE stagelabel ALTER COLUMN name TYPE TEXT; +ALTER TABLE well ALTER COLUMN externaldescription TYPE TEXT; -- From 07ece64de30b45f220b9b28a722443ca52b57f00 Mon Sep 17 00:00:00 2001 From: Mark Carroll Date: Fri, 7 Oct 2016 15:54:17 +0100 Subject: [PATCH 9/9] generate new schema --- sql/psql/OMERO5.3DEV__13/schema.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/psql/OMERO5.3DEV__13/schema.sql b/sql/psql/OMERO5.3DEV__13/schema.sql index b1fc1677235..065ffd71498 100644 --- a/sql/psql/OMERO5.3DEV__13/schema.sql +++ b/sql/psql/OMERO5.3DEV__13/schema.sql @@ -99,7 +99,7 @@ blue int4, permissions int8 not null, green int4, - lookupTable varchar(255), + lookupTable text, red int4, version int4, creation_id int8 not null, @@ -1681,7 +1681,7 @@ atime timestamp, ctime timestamp, permissions int8 not null, - hash varchar(255), + hash text, mimetype varchar(255), mtime timestamp, name text not null, @@ -1873,7 +1873,7 @@ name text not null, rowNamingConvention varchar(255), "rows" int4, - status varchar(255), + status text, version int4, wellOriginXUnit UnitsLength, wellOriginX float8, @@ -2401,7 +2401,7 @@ blue int4, "column" int4, permissions int8 not null, - externalDescription varchar(255), + externalDescription text, externalIdentifier varchar(255), green int4, red int4,