Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ADITO_Update_Upgrade
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository 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
ADITO_Update_Upgrade
Commits
d7318cb7
Commit
d7318cb7
authored
5 years ago
by
Johannes Goderbauer
Browse files
Options
Downloads
Patches
Plain Diff
Liquibase_lib fix when giving a condition
parent
5cb2af8f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
process/Liquibase_lib/process.js
+7
-7
7 additions, 7 deletions
process/Liquibase_lib/process.js
process/_test_clientProcess/process.js
+9
-3
9 additions, 3 deletions
process/_test_clientProcess/process.js
with
16 additions
and
10 deletions
process/Liquibase_lib/process.js
+
7
−
7
View file @
d7318cb7
...
...
@@ -43,9 +43,8 @@ LiquiUtils.exportAllTablesAsLiquibaseFiles = function(pOutFolderPath, pAuthor, p
if
(
ArrayUtils
.
hasElement
(
excludedTables
,
tables
[
i
],
true
))
continue
;
var
columns
=
db
.
getColumns
(
tables
[
i
],
alias
);
var
cond
=
null
;
LiquiUtils
.
exportTableAsLiquibaseFiles
(
pOutFolderPath
,
tables
[
i
],
columns
,
cond
,
pAuthor
,
pIncludeClearTableDirective
,
alias
);
LiquiUtils
.
exportTableAsLiquibaseFiles
(
pOutFolderPath
,
tables
[
i
],
null
,
cond
,
pAuthor
,
pIncludeClearTableDirective
,
alias
);
}
};
...
...
@@ -85,7 +84,7 @@ LiquiUtils.exportTableAsLiquibaseFiles = function(pPath, pTableName, pColumns, p
* @param {String} [pLobPath=not set] file-path where lob files and folders will be created; the folder must be on the server;
* if you've no lob-fields you don't have to specify somehing here
* @param {String} pTableName name of the DB-table that will be exported; this is also the name of the file that is stored
* @param {Array} pColumns db-columns within the table that will be exported
* @param {Array}
[
pColumns
=all columns within the table]
db-columns within the table that will be exported
* @param {String} [pCondition=none] db-condition to limit the data that will be exported; if nothing given the whole content will be exported
* @param {Boolean} [pIncludeClearTableDirective=false] if true, a delete element is added at the beginning of the changeset for the table
* @param {String} [pAlias=current db-alias] alias where the data will be loaded from
...
...
@@ -99,10 +98,11 @@ LiquiUtils._getDataXml = function(pAuthor, pLobPath, pTableName, pColumns, pCond
//cannot be added within jdito code to the XML-object, so instead add it as string
var
XML_HEADER_LINE
=
'
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
'
;
var
dbData
=
db
.
table
(
"
select
"
+
pColumns
.
join
(
"
,
"
)
+
"
from
"
+
pTableName
+
"
"
+
(
pCondition
?
pCondition
:
""
),
alias
);
var
columns
=
pColumns
||
db
.
getColumns
(
pTableName
,
alias
);
var
dbData
=
db
.
table
(
"
select
"
+
columns
.
join
(
"
,
"
)
+
"
from
"
+
pTableName
+
"
"
+
(
pCondition
?
"
where
"
+
pCondition
:
""
),
alias
);
if
(
dbData
.
length
==
0
)
return
""
;
var
colTypes
=
db
.
getColumnTypes
(
pTableName
,
pC
olumns
,
alias
);
var
colTypes
=
db
.
getColumnTypes
(
pTableName
,
c
olumns
,
alias
);
//every type has its function that accepts a columnName- and a value-parameter
//so let's dertermine once the corresponding funtion to its type for faster access
//(the function will only depend on the type and not change per datarow - so no need to determine the correct function per datarow)
...
...
@@ -126,7 +126,7 @@ LiquiUtils._getDataXml = function(pAuthor, pLobPath, pTableName, pColumns, pCond
else
return
LiquiXTable
.
prototype
.
addStrCol
;
});
var
columnLen
=
pC
olumns
.
length
;
var
columnLen
=
c
olumns
.
length
;
var
changeLogXml
=
LiquiXmlUtils
.
databaseChangeLog
(
author
);
if
(
pIncludeClearTableDirective
)
...
...
@@ -138,7 +138,7 @@ LiquiUtils._getDataXml = function(pAuthor, pLobPath, pTableName, pColumns, pCond
tableXml
.
setLobBasePath
(
pLobPath
);
for
(
var
i
=
0
;
i
<
columnLen
;
i
++
)
{
var
colName
=
pC
olumns
[
i
];
var
colName
=
c
olumns
[
i
];
var
value
=
row
[
i
];
var
fnToUse
=
colCallbackFn
[
i
];
if
(
fnToUse
!=
null
)
...
...
This diff is collapsed.
Click to expand it.
process/_test_clientProcess/process.js
+
9
−
3
View file @
d7318cb7
...
...
@@ -5,10 +5,16 @@ import("Liquibase_lib");
import
(
"
system.db
"
);
import
(
"
system.fileIO
"
);
var
outFolderPath
=
"
C:
\\
temp
\\
generatedData
"
;
var
alias
=
"
betterData
"
;
var
alias
=
"
_____SYSTEMALIAS
"
;
//var alias = "betterDataSys";
//var alias = "betterData";
//var alias = db.getCurrentAlias();
var
outFolderPath
=
"
C:
\\
temp
\\
generatedData
\\
"
+
alias
+
"
\\
"
;
var
excludedTables
=
[
"
AB_COUNTRYINFO
"
,
"
AB_LANGUAGE
"
];
LiquiUtils
.
exportAllTablesAsLiquibaseFiles
(
outFolderPath
,
null
,
alias
,
excludedTables
,
true
);
//LiquiUtils.exportAllTablesAsLiquibaseFiles(outFolderPath, null, alias, excludedTables, true);
alias
=
"
_____SYSTEMALIAS
"
;
outFolderPath
=
"
C:
\\
temp
\\
generatedData
\\
"
+
alias
+
"
\\
"
;
LiquiUtils
.
exportTableAsLiquibaseFiles
(
outFolderPath
,
"
ASYS_USERS
"
,
null
,
"
PROPKEY in ('mailserverAlias', 'userserverEnabled')
"
,
null
,
false
,
alias
);
logging
.
log
(
"
finish
"
);
\ No newline at end of file
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