Skip to content

Commit ec455b3

Browse files
Updated sql scripts
1 parent 9322971 commit ec455b3

128 files changed

Lines changed: 3100 additions & 465 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

flowable-sql-6.4.1/src/main/java/org/flowable/sql/CombineAllSqlGenerator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ protected static void generateCreateAll(Database database) throws Exception {
4040
String databaseName = SqlScriptUtil.getDatabaseName(database);
4141
File commonEngineFile = new File("../sql/create/common/flowable." + databaseName + ".create.common.sql");
4242
File bpmnEngineFile = new File("../sql/create/bpmn/flowable." + databaseName + ".create.engine.sql");
43+
File idmEngineFile = new File("../sql/create/idm/flowable." + databaseName + ".idm-engine.create.sql");
4344
File appEngineFile = new File("../sql/create/app/flowable." + databaseName + ".app-engine.create.sql");
4445
File dmnEngineFile = new File("../sql/create/dmn/flowable." + databaseName + ".dmn-engine.create.sql");
4546
File cmmnEngineFile = new File("../sql/create/cmmn/flowable." + databaseName + ".cmmn-engine.create.sql");
@@ -56,7 +57,7 @@ protected static void generateCreateAll(Database database) throws Exception {
5657
}
5758
allFile.createNewFile();
5859

59-
joinFiles(allFile, commonEngineFile, bpmnEngineFile, appEngineFile, cmmnEngineFile,
60+
joinFiles(allFile, commonEngineFile, bpmnEngineFile, idmEngineFile, appEngineFile, cmmnEngineFile,
6061
dmnEngineFile, formEngineFile, contentEngineFile);
6162
}
6263

flowable-sql-6.4.1/src/main/java/org/flowable/sql/CombineUpgradeSqlGenerator.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ protected static void generateUpgradeAll(Database database, String oldVersion, S
4343
String databaseName = SqlScriptUtil.getDatabaseName(database);
4444
File commonEngineFile = new File("../sql/upgrade/common/flowable." + databaseName + ".upgradestep." + oldVersion + ".to." + newVersion + ".common.sql");
4545
File bpmnEngineFile = new File("../sql/upgrade/bpmn/flowable." + databaseName + ".upgradestep." + oldVersion + ".to." + newVersion + ".engine.sql");
46+
File idmEngineFile = new File("../sql/upgrade/idm/flowable." + databaseName + ".upgradestep." + oldVersion + ".to." + newVersion + ".identity.sql");
4647
File appEngineFile = new File("../sql/upgrade/app/flowable." + databaseName + ".upgradestep." + oldVersion + ".to." + newVersion + ".app.sql");
4748
File dmnEngineFile = new File("../sql/upgrade/dmn/flowable." + databaseName + ".upgradestep." + oldVersion + ".to." + newVersion + ".dmn.sql");
4849
File cmmnEngineFile = new File("../sql/upgrade/cmmn/flowable." + databaseName + ".upgradestep." + oldVersion + ".to." + newVersion + ".cmmn.sql");
@@ -59,8 +60,8 @@ protected static void generateUpgradeAll(Database database, String oldVersion, S
5960
}
6061
allFile.createNewFile();
6162

62-
joinFiles(allFile, commonEngineFile, bpmnEngineFile, appEngineFile, cmmnEngineFile, dmnEngineFile,
63-
formEngineFile, contentEngineFile);
63+
joinFiles(allFile, commonEngineFile, bpmnEngineFile, idmEngineFile, appEngineFile, cmmnEngineFile,
64+
dmnEngineFile, formEngineFile, contentEngineFile);
6465
}
6566

6667
protected static Database getDatabaseInstance() throws Exception {

flowable-sql-6.4.2/pom.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,32 +24,32 @@
2424
<dependency>
2525
<groupId>org.flowable</groupId>
2626
<artifactId>flowable-app-engine</artifactId>
27-
<version>6.4.2-SNAPSHOT</version>
27+
<version>6.4.2</version>
2828
</dependency>
2929
<dependency>
3030
<groupId>org.flowable</groupId>
3131
<artifactId>flowable-engine</artifactId>
32-
<version>6.4.2-SNAPSHOT</version>
32+
<version>6.4.2</version>
3333
</dependency>
3434
<dependency>
3535
<groupId>org.flowable</groupId>
3636
<artifactId>flowable-cmmn-engine</artifactId>
37-
<version>6.4.2-SNAPSHOT</version>
37+
<version>6.4.2</version>
3838
</dependency>
3939
<dependency>
4040
<groupId>org.flowable</groupId>
4141
<artifactId>flowable-dmn-engine</artifactId>
42-
<version>6.4.2-SNAPSHOT</version>
42+
<version>6.4.2</version>
4343
</dependency>
4444
<dependency>
4545
<groupId>org.flowable</groupId>
4646
<artifactId>flowable-form-engine</artifactId>
47-
<version>6.4.2-SNAPSHOT</version>
47+
<version>6.4.2</version>
4848
</dependency>
4949
<dependency>
5050
<groupId>org.flowable</groupId>
5151
<artifactId>flowable-content-engine</artifactId>
52-
<version>6.4.2-SNAPSHOT</version>
52+
<version>6.4.2</version>
5353
</dependency>
5454

5555
</dependencies>

flowable-sql-6.4.2/src/main/java/org/flowable/sql/CombineAllSqlGenerator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ protected static void generateCreateAll(Database database) throws Exception {
4040
String databaseName = SqlScriptUtil.getDatabaseName(database);
4141
File commonEngineFile = new File("../sql/create/common/flowable." + databaseName + ".create.common.sql");
4242
File bpmnEngineFile = new File("../sql/create/bpmn/flowable." + databaseName + ".create.engine.sql");
43+
File idmEngineFile = new File("../sql/create/idm/flowable." + databaseName + ".idm-engine.create.sql");
4344
File appEngineFile = new File("../sql/create/app/flowable." + databaseName + ".app-engine.create.sql");
4445
File dmnEngineFile = new File("../sql/create/dmn/flowable." + databaseName + ".dmn-engine.create.sql");
4546
File cmmnEngineFile = new File("../sql/create/cmmn/flowable." + databaseName + ".cmmn-engine.create.sql");
@@ -56,7 +57,7 @@ protected static void generateCreateAll(Database database) throws Exception {
5657
}
5758
allFile.createNewFile();
5859

59-
joinFiles(allFile, commonEngineFile, bpmnEngineFile, appEngineFile, cmmnEngineFile,
60+
joinFiles(allFile, commonEngineFile, bpmnEngineFile, idmEngineFile, appEngineFile, cmmnEngineFile,
6061
dmnEngineFile, formEngineFile, contentEngineFile);
6162
}
6263

flowable-sql-6.4.2/src/main/java/org/flowable/sql/CombineUpgradeSqlGenerator.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ protected static void generateUpgradeAll(Database database, String oldVersion, S
4343
String databaseName = SqlScriptUtil.getDatabaseName(database);
4444
File commonEngineFile = new File("../sql/upgrade/common/flowable." + databaseName + ".upgradestep." + oldVersion + ".to." + newVersion + ".common.sql");
4545
File bpmnEngineFile = new File("../sql/upgrade/bpmn/flowable." + databaseName + ".upgradestep." + oldVersion + ".to." + newVersion + ".engine.sql");
46+
File idmEngineFile = new File("../sql/upgrade/idm/flowable." + databaseName + ".upgradestep." + oldVersion + ".to." + newVersion + ".identity.sql");
4647
File appEngineFile = new File("../sql/upgrade/app/flowable." + databaseName + ".upgradestep." + oldVersion + ".to." + newVersion + ".app.sql");
4748
File dmnEngineFile = new File("../sql/upgrade/dmn/flowable." + databaseName + ".upgradestep." + oldVersion + ".to." + newVersion + ".dmn.sql");
4849
File cmmnEngineFile = new File("../sql/upgrade/cmmn/flowable." + databaseName + ".upgradestep." + oldVersion + ".to." + newVersion + ".cmmn.sql");
@@ -59,8 +60,8 @@ protected static void generateUpgradeAll(Database database, String oldVersion, S
5960
}
6061
allFile.createNewFile();
6162

62-
joinFiles(allFile, commonEngineFile, bpmnEngineFile, appEngineFile, cmmnEngineFile, dmnEngineFile,
63-
formEngineFile, contentEngineFile);
63+
joinFiles(allFile, commonEngineFile, bpmnEngineFile, idmEngineFile, appEngineFile, cmmnEngineFile,
64+
dmnEngineFile, formEngineFile, contentEngineFile);
6465
}
6566

6667
protected static Database getDatabaseInstance() throws Exception {
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
/* Licensed under the Apache License, Version 2.0 (the "License");
2+
* you may not use this file except in compliance with the License.
3+
* You may obtain a copy of the License at
4+
*
5+
* http://www.apache.org/licenses/LICENSE-2.0
6+
*
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*/
13+
package org.flowable.sql;
14+
15+
import org.flowable.app.engine.AppEngineConfiguration;
16+
import org.flowable.app.engine.impl.db.AppDbSchemaManager;
17+
import org.flowable.cmmn.engine.CmmnEngineConfiguration;
18+
import org.flowable.cmmn.engine.impl.db.CmmnDbSchemaManager;
19+
import org.flowable.common.sql.DbDropUtil;
20+
import org.flowable.content.engine.ContentEngineConfiguration;
21+
import org.flowable.content.engine.impl.db.ContentDbSchemaManager;
22+
import org.flowable.dmn.engine.DmnEngineConfiguration;
23+
import org.flowable.dmn.engine.impl.db.DmnDbSchemaManager;
24+
import org.flowable.engine.ProcessEngineConfiguration;
25+
import org.flowable.form.engine.FormEngineConfiguration;
26+
import org.flowable.form.engine.impl.db.FormDbSchemaManager;
27+
28+
import liquibase.Liquibase;
29+
import liquibase.database.Database;
30+
import liquibase.database.DatabaseConnection;
31+
import liquibase.database.DatabaseFactory;
32+
import liquibase.resource.ClassLoaderResourceAccessor;
33+
34+
public class UpdateDatabase {
35+
36+
public static void main(String[] args) throws Exception {
37+
ProcessEngineConfiguration engineConfiguration = ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("flowable.cfg.xml");
38+
DbDropUtil.dropDatabaseTable(engineConfiguration.getJdbcDriver(), engineConfiguration.getJdbcUrl(),
39+
engineConfiguration.getJdbcUsername(), engineConfiguration.getJdbcPassword());
40+
41+
updateAppEngine();
42+
updateCmmnEngine();
43+
updateDmnEngine();
44+
updateFormEngine();
45+
updateContentEngine();
46+
}
47+
48+
protected static void updateAppEngine() throws Exception {
49+
Database database = getDatabaseInstance();
50+
database.setDatabaseChangeLogTableName(AppEngineConfiguration.LIQUIBASE_CHANGELOG_PREFIX + database.getDatabaseChangeLogTableName());
51+
database.setDatabaseChangeLogLockTableName(AppEngineConfiguration.LIQUIBASE_CHANGELOG_PREFIX + database.getDatabaseChangeLogLockTableName());
52+
Liquibase liquibase = new Liquibase(AppDbSchemaManager.LIQUIBASE_CHANGELOG, new ClassLoaderResourceAccessor(), database);
53+
liquibase.update("app");
54+
}
55+
56+
protected static void updateCmmnEngine() throws Exception {
57+
Database database = getDatabaseInstance();
58+
database.setDatabaseChangeLogTableName(CmmnEngineConfiguration.LIQUIBASE_CHANGELOG_PREFIX + database.getDatabaseChangeLogTableName());
59+
database.setDatabaseChangeLogLockTableName(CmmnEngineConfiguration.LIQUIBASE_CHANGELOG_PREFIX + database.getDatabaseChangeLogLockTableName());
60+
Liquibase liquibase = new Liquibase(CmmnDbSchemaManager.LIQUIBASE_CHANGELOG, new ClassLoaderResourceAccessor(), database);
61+
liquibase.update("cmmn");
62+
}
63+
64+
protected static void updateDmnEngine() throws Exception {
65+
Database database = getDatabaseInstance();
66+
database.setDatabaseChangeLogTableName(DmnEngineConfiguration.LIQUIBASE_CHANGELOG_PREFIX + database.getDatabaseChangeLogTableName());
67+
database.setDatabaseChangeLogLockTableName(DmnEngineConfiguration.LIQUIBASE_CHANGELOG_PREFIX + database.getDatabaseChangeLogLockTableName());
68+
Liquibase liquibase = new Liquibase(DmnDbSchemaManager.LIQUIBASE_CHANGELOG, new ClassLoaderResourceAccessor(), database);
69+
liquibase.update("dmn");
70+
}
71+
72+
protected static void updateFormEngine() throws Exception {
73+
Database database = getDatabaseInstance();
74+
database.setDatabaseChangeLogTableName(FormEngineConfiguration.LIQUIBASE_CHANGELOG_PREFIX + database.getDatabaseChangeLogTableName());
75+
database.setDatabaseChangeLogLockTableName(FormEngineConfiguration.LIQUIBASE_CHANGELOG_PREFIX + database.getDatabaseChangeLogLockTableName());
76+
Liquibase liquibase = new Liquibase(FormDbSchemaManager.LIQUIBASE_CHANGELOG, new ClassLoaderResourceAccessor(), database);
77+
liquibase.update("form");
78+
}
79+
80+
protected static void updateContentEngine() throws Exception {
81+
Database database = getDatabaseInstance();
82+
database.setDatabaseChangeLogTableName(ContentEngineConfiguration.LIQUIBASE_CHANGELOG_PREFIX + database.getDatabaseChangeLogTableName());
83+
database.setDatabaseChangeLogLockTableName(ContentEngineConfiguration.LIQUIBASE_CHANGELOG_PREFIX + database.getDatabaseChangeLogLockTableName());
84+
Liquibase liquibase = new Liquibase(ContentDbSchemaManager.LIQUIBASE_CHANGELOG, new ClassLoaderResourceAccessor(), database);
85+
liquibase.update("content");
86+
}
87+
88+
protected static Database getDatabaseInstance() throws Exception {
89+
ProcessEngineConfiguration engineConfiguration = ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("flowable.cfg.xml");
90+
DatabaseFactory databaseFactory = DatabaseFactory.getInstance();
91+
DatabaseConnection connection = databaseFactory.openConnection(engineConfiguration.getJdbcUrl(), engineConfiguration.getJdbcUsername(),
92+
engineConfiguration.getJdbcPassword(), engineConfiguration.getJdbcDriver(), null, null, null, new ClassLoaderResourceAccessor());
93+
return DatabaseFactory.getInstance().findCorrectDatabaseImplementation(connection);
94+
}
95+
96+
}

flowable-sql-6.5.0/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target/

flowable-sql-6.5.0/pom.xml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<name>Flowable SQL 6.5.0</name>
7+
<artifactId>flowable-sql-6.5.0</artifactId>
8+
<packaging>jar</packaging>
9+
10+
<parent>
11+
<groupId>org.flowable</groupId>
12+
<artifactId>flowable-sql</artifactId>
13+
<version>1.0</version>
14+
</parent>
15+
16+
<dependencies>
17+
<dependency>
18+
<groupId>org.flowable</groupId>
19+
<artifactId>flowable-sql-common</artifactId>
20+
<version>1.0</version>
21+
</dependency>
22+
23+
<!-- Flowable dependencies -->
24+
<dependency>
25+
<groupId>org.flowable</groupId>
26+
<artifactId>flowable-app-engine</artifactId>
27+
<version>6.5.0-SNAPSHOT</version>
28+
</dependency>
29+
<dependency>
30+
<groupId>org.flowable</groupId>
31+
<artifactId>flowable-engine</artifactId>
32+
<version>6.5.0-SNAPSHOT</version>
33+
</dependency>
34+
<dependency>
35+
<groupId>org.flowable</groupId>
36+
<artifactId>flowable-cmmn-engine</artifactId>
37+
<version>6.5.0-SNAPSHOT</version>
38+
</dependency>
39+
<dependency>
40+
<groupId>org.flowable</groupId>
41+
<artifactId>flowable-dmn-engine</artifactId>
42+
<version>6.5.0-SNAPSHOT</version>
43+
</dependency>
44+
<dependency>
45+
<groupId>org.flowable</groupId>
46+
<artifactId>flowable-form-engine</artifactId>
47+
<version>6.5.0-SNAPSHOT</version>
48+
</dependency>
49+
<dependency>
50+
<groupId>org.flowable</groupId>
51+
<artifactId>flowable-content-engine</artifactId>
52+
<version>6.5.0-SNAPSHOT</version>
53+
</dependency>
54+
55+
</dependencies>
56+
57+
58+
</project>
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
/* Licensed under the Apache License, Version 2.0 (the "License");
2+
* you may not use this file except in compliance with the License.
3+
* You may obtain a copy of the License at
4+
*
5+
* http://www.apache.org/licenses/LICENSE-2.0
6+
*
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*/
13+
package org.flowable.sql;
14+
15+
import java.io.BufferedInputStream;
16+
import java.io.BufferedOutputStream;
17+
import java.io.File;
18+
import java.io.FileInputStream;
19+
import java.io.FileOutputStream;
20+
import java.io.InputStream;
21+
import java.io.OutputStream;
22+
23+
import org.apache.commons.io.IOUtils;
24+
import org.flowable.common.sql.SqlScriptUtil;
25+
import org.flowable.engine.ProcessEngineConfiguration;
26+
27+
import liquibase.database.Database;
28+
import liquibase.database.DatabaseConnection;
29+
import liquibase.database.DatabaseFactory;
30+
import liquibase.resource.ClassLoaderResourceAccessor;
31+
32+
public class CombineAllSqlGenerator {
33+
34+
public static void main(String[] args) throws Exception {
35+
Database database = getDatabaseInstance();
36+
generateCreateAll(database);
37+
}
38+
39+
protected static void generateCreateAll(Database database) throws Exception {
40+
String databaseName = SqlScriptUtil.getDatabaseName(database);
41+
File commonEngineFile = new File("../sql/create/common/flowable." + databaseName + ".create.common.sql");
42+
File bpmnEngineFile = new File("../sql/create/bpmn/flowable." + databaseName + ".create.engine.sql");
43+
File idmEngineFile = new File("../sql/create/idm/flowable." + databaseName + ".idm-engine.create.sql");
44+
File appEngineFile = new File("../sql/create/app/flowable." + databaseName + ".app-engine.create.sql");
45+
File dmnEngineFile = new File("../sql/create/dmn/flowable." + databaseName + ".dmn-engine.create.sql");
46+
File cmmnEngineFile = new File("../sql/create/cmmn/flowable." + databaseName + ".cmmn-engine.create.sql");
47+
File formEngineFile = new File("../sql/create/form/flowable." + databaseName + ".form-engine.create.sql");
48+
File contentEngineFile = new File("../sql/create/content/flowable." + databaseName + ".content-engine.create.sql");
49+
50+
File allDir = new File("../sql/create/all");
51+
if (!allDir.exists()) {
52+
allDir.mkdir();
53+
}
54+
File allFile = new File("../sql/create/all/flowable." + databaseName + ".all.create.sql");
55+
if (allFile.exists()) {
56+
allFile.delete();
57+
}
58+
allFile.createNewFile();
59+
60+
joinFiles(allFile, commonEngineFile, bpmnEngineFile, idmEngineFile, appEngineFile, cmmnEngineFile,
61+
dmnEngineFile, formEngineFile, contentEngineFile);
62+
}
63+
64+
protected static Database getDatabaseInstance() throws Exception {
65+
ProcessEngineConfiguration engineConfiguration = ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("flowable.cfg.xml");
66+
DatabaseFactory databaseFactory = DatabaseFactory.getInstance();
67+
DatabaseConnection connection = databaseFactory.openConnection(engineConfiguration.getJdbcUrl(), engineConfiguration.getJdbcUsername(),
68+
engineConfiguration.getJdbcPassword(), engineConfiguration.getJdbcDriver(), null, null, null, new ClassLoaderResourceAccessor());
69+
return DatabaseFactory.getInstance().findCorrectDatabaseImplementation(connection);
70+
}
71+
72+
public static void joinFiles(File destination, File... sources) throws Exception {
73+
try (OutputStream output = createAppendableStream(destination)) {
74+
for (File source : sources) {
75+
appendFile(output, source);
76+
}
77+
}
78+
}
79+
80+
protected static BufferedOutputStream createAppendableStream(File destination) throws Exception {
81+
return new BufferedOutputStream(new FileOutputStream(destination, true));
82+
}
83+
84+
private static void appendFile(OutputStream output, File source) throws Exception {
85+
try (InputStream input = new BufferedInputStream(new FileInputStream(source))) {
86+
IOUtils.copy(input, output);
87+
}
88+
}
89+
90+
}

0 commit comments

Comments
 (0)