Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
basic
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
xrm
basic
Commits
291d9df1
Commit
291d9df1
authored
4 years ago
by
Tom Lutzenberger
Committed by
Johannes Goderbauer
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added upgrade process
parent
8f4e113e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
process/migrateKeywordContainers/migrateKeywordContainers.aod
+12
-0
12 additions, 0 deletions
...ess/migrateKeywordContainers/migrateKeywordContainers.aod
process/migrateKeywordContainers/process.js
+44
-0
44 additions, 0 deletions
process/migrateKeywordContainers/process.js
with
56 additions
and
0 deletions
process/migrateKeywordContainers/migrateKeywordContainers.aod
0 → 100644
+
12
−
0
View file @
291d9df1
<?xml version="1.0" encoding="UTF-8"?>
<process
xmlns=
"http://www.adito.de/2018/ao/Model"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
VERSION=
"1.2.1"
xsi:schemaLocation=
"http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"
>
<name>
migrateKeywordContainers
</name>
<title>
Migrate keyword containers
</title>
<majorModelMode>
DISTRIBUTED
</majorModelMode>
<process>
%aditoprj%/process/migrateKeywordContainers/process.js
</process>
<publishAsWebservice
v=
"true"
/>
<alias>
Data_alias
</alias>
<variants>
<element>
EXECUTABLE
</element>
</variants>
</process>
This diff is collapsed.
Click to expand it.
process/migrateKeywordContainers/process.js
0 → 100644
+
44
−
0
View file @
291d9df1
import
(
"
system.db
"
);
import
(
"
system.logging
"
);
import
(
"
system.util
"
);
import
(
"
system.vars
"
);
import
(
"
Sql_lib
"
);
import
(
"
Util_lib
"
);
var
newKeywordContainers
=
[];
var
oldKeywordContainers
=
newSelect
(
"
AB_KEYWORD_ENTRY.CONTAINER
"
)
.
from
(
"
AB_KEYWORD_ENTRY
"
)
.
where
(
"
AB_KEYWORD_ENTRY.CONTAINER
"
,
newSelect
(
"
1
"
)
.
from
(
"
AB_KEYWORD_CATEGORY
"
)
.
where
(
"
AB_KEYWORD_CATEGORY.NAME = AB_KEYWORD_ENTRY.CONTAINER
"
)
,
SqlBuilder
.
NOT_EXISTS
())
.
groupBy
(
"
AB_KEYWORD_ENTRY.CONTAINER
"
)
.
orderBy
(
"
AB_KEYWORD_ENTRY.CONTAINER
"
)
.
arrayColumn
();
oldKeywordContainers
.
forEach
(
function
(
pElement
,
pIndex
,
pArray
)
{
var
columns
=
[
"
AB_KEYWORD_CATEGORYID
"
,
"
NAME
"
,
"
SORTINGBY
"
,
"
SORTINGDIRECTION
"
];
var
values
=
[
util
.
getNewUUID
(),
pElement
,
0
,
"
ASC
"
];
logging
.
log
(
values
);
//(new SqlBuilder()).insertData("AB_KEYWORD_CATEGORY", columns, null, values);
});
var
keywordUpdateQuery
=
"
UPDATE AB_KEYWORD_ENTRY
"
+
"
SET AB_KEYWORD_CATEGORY_ID = (
"
+
"
SELECT AB_KEYWORD_CATEGORYID
"
+
"
FROM AB_KEYWORD_CATEGORY
"
+
"
WHERE AB_KEYWORD_CATEGORY.NAME = AB_KEYWORD_ENTRY.CONTAINER
"
+
"
);
"
;
var
attributeUpdateQuery
=
"
UPDATE AB_KEYWORD_ATTRIBUTE
"
+
"
SET AB_KEYWORD_CATEGORY_ID = (
"
+
"
SELECT AB_KEYWORD_CATEGORYID
"
+
"
FROM AB_KEYWORD_CATEGORY
"
+
"
WHERE AB_KEYWORD_CATEGORY.NAME = AB_KEYWORD_ATTRIBUTE.CONTAINER
"
+
"
);
"
;
//logging.log(db.runStatement(keywordUpdateQuery) + " keyword containers updated");
//logging.log(db.runStatement(attributeUpdateQuery) + " attribute containers updated");
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