From bb7b0de66299462a77e98d7c1f95f244ba4e1d2d Mon Sep 17 00:00:00 2001
From: "piotr.gawron" <piotr.gawron@uni-new>
Date: Fri, 7 Oct 2016 10:48:55 +0200
Subject: [PATCH] fix on db (removing parent)

---
 persist/src/db/10.0.3/fix_db_20161007.sql | 5 +++++
 1 file changed, 5 insertions(+)
 create mode 100644 persist/src/db/10.0.3/fix_db_20161007.sql

diff --git a/persist/src/db/10.0.3/fix_db_20161007.sql b/persist/src/db/10.0.3/fix_db_20161007.sql
new file mode 100644
index 0000000000..b04aae4085
--- /dev/null
+++ b/persist/src/db/10.0.3/fix_db_20161007.sql
@@ -0,0 +1,5 @@
+update element_table set idcomplexdb=parent_iddb where idcomplexdb is null and parent_iddb is not null and parent_iddb in (select iddb from element_table where element_type_db= 'Complex');
+
+update element_table set compartment_iddb = parent_iddb where compartment_iddb is null and parent_iddb is not null and parent_iddb in (select iddb from element_table where element_type_db<> 'Complex');
+
+alter table element_table  drop COLUMN parent_iddb ;
\ No newline at end of file
-- 
GitLab