Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
f2cf8ce1
Commit
f2cf8ce1
authored
1 year ago
by
vkovtun
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-14216: Not doing update for frozen entities to avoid errors.
parent
ac753dca
No related branches found
No related tags found
1 merge request
!40
SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/hotfix/ELNFixes.java
+9
-8
9 additions, 8 deletions
...systemsx/cisd/openbis/generic/server/hotfix/ELNFixes.java
with
9 additions
and
8 deletions
server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/hotfix/ELNFixes.java
+
9
−
8
View file @
f2cf8ce1
...
...
@@ -46,9 +46,9 @@ public class ELNFixes {
storageValidationLevelFix
(
sessionToken
,
api
);
nameNoRTFFix
(
sessionToken
,
api
);
// TODO(alaskowski): SSDM-13831: Do migration here!!!
fixProperties
(
"sample_properties"
,
"sample_type_property_types"
,
"stpt_id"
);
fixProperties
(
"experiment_properties"
,
"experiment_type_property_types"
,
"etpt_id"
);
fixProperties
(
"data_set_properties"
,
"data_set_type_property_types"
,
"dstpt_id"
);
fixProperties
(
"sample_properties"
,
"sample_type_property_types"
,
"stpt_id"
,
"samp_frozen"
);
fixProperties
(
"experiment_properties"
,
"experiment_type_property_types"
,
"etpt_id"
,
"expe_frozen"
);
fixProperties
(
"data_set_properties"
,
"data_set_type_property_types"
,
"dstpt_id"
,
"dase_frozen"
);
operationLog
.
info
(
"ELNFixes beforeUpgrade FINISH"
);
}
...
...
@@ -135,23 +135,24 @@ public class ELNFixes {
}
private
static
void
fixProperties
(
final
String
propertiesTable
,
final
String
entityTypePropertyTypesTable
,
final
String
entityTypePropertyTypesColumn
)
{
final
String
entityTypePropertyTypesColumn
,
final
String
frozenColumn
)
{
ELNCollectionTypeMigration
.
executeNativeUpdate
(
String
.
format
(
"UPDATE %s prop\n"
+
"SET value = null\n"
+
"FROM %s etpt\n"
+
"INNER JOIN property_types prty ON etpt.prty_id = prty.id\n"
+
"INNER JOIN data_types daty ON prty.daty_id = daty.id\n"
+
"WHERE prop.%s IS NOT NULL AND prop.%s = etpt.id AND daty.code = 'CONTROLLEDVOCABULARY'"
,
propertiesTable
,
entityTypePropertyTypesTable
,
entityTypePropertyTypesColumn
,
entityTypePropertyTypesColumn
));
+
"WHERE prop.%s IS NOT NULL AND prop.%s = etpt.id AND daty.code = 'CONTROLLEDVOCABULARY'
AND prop.%s = false
"
,
propertiesTable
,
entityTypePropertyTypesTable
,
entityTypePropertyTypesColumn
,
entityTypePropertyTypesColumn
,
frozenColumn
));
ELNCollectionTypeMigration
.
executeNativeUpdate
(
String
.
format
(
"UPDATE %s prop\n"
+
"SET cvte_id = null\n"
+
"FROM %s etpt\n"
+
"INNER JOIN property_types prty ON etpt.prty_id = prty.id\n"
+
"INNER JOIN data_types daty ON prty.daty_id = daty.id\n"
+
"WHERE prop.%s IS NOT NULL AND prop.%s = etpt.id AND daty.code != 'CONTROLLEDVOCABULARY'"
,
propertiesTable
,
entityTypePropertyTypesTable
,
entityTypePropertyTypesColumn
,
entityTypePropertyTypesColumn
));
+
"WHERE prop.%s IS NOT NULL AND prop.%s = etpt.id AND daty.code != 'CONTROLLEDVOCABULARY' AND prop.%s = false"
,
propertiesTable
,
entityTypePropertyTypesTable
,
entityTypePropertyTypesColumn
,
entityTypePropertyTypesColumn
,
frozenColumn
));
operationLog
.
info
(
String
.
format
(
"ELNFixes fixProperties for propertiesTable %s"
,
propertiesTable
));
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment