Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
1add28e475 | |||
|
2622f0b6cf | ||
|
72093b990d | ||
|
b01da71743 | ||
|
0daf204509 | ||
|
3cd2b807ca | ||
|
3816a22675 | ||
|
f3e65ebdb7 |
6
CREDITS
6
CREDITS
@ -9,8 +9,8 @@
|
||||
----------
|
||||
|
||||
N: Robert Vokac
|
||||
E: robertvokac@nanoboot.org
|
||||
W: https://nanoboot.org
|
||||
P: 4096R/E3329055 322B D109 0AA8 C324 EA9C 72F5 693D 30BE E332 9055
|
||||
E: robertvokac@robertvokac.com
|
||||
W: https://robertvokac.com
|
||||
P: 4096R/C459E1E4 255C 69CC 1D09 CA54 EF0C C9DF FB9C E8E2 0AAD A55F
|
||||
D: Founder
|
||||
S: Czech Republic
|
||||
|
114
Jenkinsfile
vendored
Normal file
114
Jenkinsfile
vendored
Normal file
@ -0,0 +1,114 @@
|
||||
pipeline
|
||||
/*
|
||||
DB Migration
|
||||
|
||||
Requirements:
|
||||
|
||||
Maven is Installed
|
||||
|
||||
Java 21 is installed - variable JAVA_21_HOME is set
|
||||
|
||||
*/
|
||||
{
|
||||
agent any
|
||||
environment {
|
||||
AAA = 'aaa'
|
||||
}
|
||||
stages
|
||||
{
|
||||
stage('Build')
|
||||
{
|
||||
steps {
|
||||
|
||||
echo "*** Building ${env.JOB_NAME} ***"
|
||||
sh '''
|
||||
#!/bin/bash
|
||||
echo JOB_NAME=$JOB_NAME
|
||||
|
||||
if [ -z "$JAVA_21_HOME" ]
|
||||
then
|
||||
echo "KO : Variable JAVA_21_HOME is empty. You fix this issue by adding this variable to configuration of Jenkins."
|
||||
exit 1
|
||||
else
|
||||
echo "OK : Variable JAVA_21_HOME is NOT empty"
|
||||
fi
|
||||
export JAVA_HOME=$JAVA_21_HOME
|
||||
case $BRANCH_NAME in
|
||||
|
||||
master | deploy_prod)
|
||||
mvn clean install
|
||||
;;
|
||||
|
||||
develop | jenkins | deploy_test)
|
||||
echo Branch $BRANCH_NAME is supported. Continuing.
|
||||
version=`mvn help:evaluate -Dexpression=project.version -q -DforceStdout`
|
||||
echo version=$version
|
||||
case "$version" in
|
||||
*"SNAPSHOT"*) echo echo version is OK ;;
|
||||
* ) echo echo "You cannot build releases on Jenkins, only snapshots!"&&exit 1 ;;
|
||||
esac
|
||||
mvn clean deploy
|
||||
;;
|
||||
|
||||
*)
|
||||
echo Branch $BRANCH_NAME is not supported. A failure happened. Exiting.
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Build of $JOB_NAME was successful"
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy')
|
||||
{
|
||||
steps {
|
||||
echo "*** Deploying ${env.JOB_NAME} ***"
|
||||
|
||||
sh '''
|
||||
#!/bin/bash
|
||||
|
||||
echo "Nothing to do"
|
||||
exit
|
||||
|
||||
case $BRANCH_NAME in
|
||||
|
||||
master | deploy_prod)
|
||||
echo Branch $BRANCH_NAME is supported. Continuing.
|
||||
TOMCAT_HOME=$TOMCAT10_HOME
|
||||
systemdService=tomcat10
|
||||
;;
|
||||
|
||||
develop | jenkins | deploy_test)
|
||||
echo Branch $BRANCH_NAME is supported. Continuing.
|
||||
TOMCAT_HOME=$TOMCAT10_TEST_HOME
|
||||
systemdService=tomcat10test
|
||||
;;
|
||||
|
||||
*)
|
||||
echo Branch $BRANCH_NAME is not supported. A failure happened. Exiting.
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
'''
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
script {
|
||||
env.color = "${currentBuild.currentResult == 'SUCCESS' ? 'green' : 'red'}"
|
||||
}
|
||||
|
||||
echo 'Sending e-mail.'
|
||||
sh "printenv | sort"
|
||||
emailext body: "<b style=\"color:$COLOR\">${currentBuild.currentResult}</b> - ${env.JOB_NAME} (#${env.BUILD_NUMBER})<br> <ul style=\"margin-top:2px;padding-top:2px;padding-left:30px;\"><li>More info at: <a href=\"${env.BUILD_URL}\">${env.BUILD_URL}</a></li></ul>",
|
||||
recipientProviders: [[$class: 'DevelopersRecipientProvider'], [$class: 'RequesterRecipientProvider']],
|
||||
subject: "Jenkins Build - ${currentBuild.currentResult} - $JOB_NAME (#$BUILD_NUMBER)"
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -23,12 +23,12 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.nanoboot.tools.dbmigration</groupId>
|
||||
<groupId>com.robertvokac.tools.dbmigration</groupId>
|
||||
<artifactId>db-migration</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.nanoboot.tools.dbmigration</groupId>
|
||||
<groupId>com.robertvokac.tools.dbmigration</groupId>
|
||||
<artifactId>db-migration-core</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
@ -77,7 +77,7 @@
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>org.nanoboot.dbmigration.core.main.DBMigration</mainClass>
|
||||
<mainClass>com.robertvokac.dbmigration.core.main.DBMigration</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
<descriptorRefs>
|
||||
@ -132,11 +132,11 @@
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-core</artifactId>
|
||||
<version>${flyway-core.version}</version>
|
||||
</dependency>
|
||||
</dependency>-->
|
||||
<!-- Lombok-->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
@ -151,17 +151,17 @@
|
||||
</dependency>
|
||||
<!-- Power dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.nanoboot.powerframework</groupId>
|
||||
<groupId>com.robertvokac.powerframework</groupId>
|
||||
<artifactId>power-time</artifactId>
|
||||
<version>${power.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.nanoboot.powerframework</groupId>
|
||||
<groupId>com.robertvokac.powerframework</groupId>
|
||||
<artifactId>power-core</artifactId>
|
||||
<version>${power.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.nanoboot.powerframework</groupId>
|
||||
<groupId>com.robertvokac.powerframework</groupId>
|
||||
<artifactId>power-security</artifactId>
|
||||
<version>${power.version}</version>
|
||||
</dependency>
|
||||
@ -203,7 +203,7 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.nanoboot.tools.dbmigration</groupId>
|
||||
<groupId>com.robertvokac.tools.dbmigration</groupId>
|
||||
<artifactId>db-migration-test-jar</artifactId>
|
||||
<version>${dbmigration.version}</version>
|
||||
<scope>test</scope>
|
||||
|
@ -2,22 +2,23 @@
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// version 2.1 of the License only.
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.configuration;
|
||||
package com.robertvokac.dbmigration.core.configuration;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@ -25,11 +26,11 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.nanoboot.dbmigration.core.main.DBMigrationException;
|
||||
import com.robertvokac.dbmigration.core.main.DBMigrationException;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public class Configuration {
|
@ -2,32 +2,33 @@
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// version 2.1 of the License only.
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.configuration;
|
||||
package com.robertvokac.dbmigration.core.configuration;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.nanoboot.dbmigration.core.main.DBMigrationException;
|
||||
import com.robertvokac.dbmigration.core.main.DBMigrationException;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
@Data
|
@ -2,26 +2,27 @@
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// version 2.1 of the License only.
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.configuration;
|
||||
package com.robertvokac.dbmigration.core.configuration;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public class ConfigurationKeys {
|
@ -2,22 +2,23 @@
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// version 2.1 of the License only.
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.entity;
|
||||
package com.robertvokac.dbmigration.core.entity;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
@ -26,13 +27,13 @@ import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.nanoboot.dbmigration.core.main.DBMigrationException;
|
||||
import org.nanoboot.dbmigration.core.main.MigrationType;
|
||||
import org.nanoboot.dbmigration.core.utils.DBMigrationUtils;
|
||||
import com.robertvokac.dbmigration.core.main.DBMigrationException;
|
||||
import com.robertvokac.dbmigration.core.main.MigrationType;
|
||||
import com.robertvokac.dbmigration.core.utils.DBMigrationUtils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
@Data
|
@ -2,22 +2,23 @@
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// version 2.1 of the License only.
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.main;
|
||||
package com.robertvokac.dbmigration.core.main;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
@ -32,23 +33,23 @@ import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.nanoboot.dbmigration.core.configuration.Configuration;
|
||||
import org.nanoboot.dbmigration.core.configuration.ConfigurationEntry;
|
||||
import org.nanoboot.dbmigration.core.configuration.ConfigurationKeys;
|
||||
import org.nanoboot.dbmigration.core.entity.DBMigrationSchemaHistory;
|
||||
import org.nanoboot.dbmigration.core.resources.SqlFile;
|
||||
import org.nanoboot.dbmigration.core.persistence.api.DBMigrationPersistence;
|
||||
import org.nanoboot.dbmigration.core.query.DBMigrationSchemaHistoryTable;
|
||||
import org.nanoboot.dbmigration.core.resources.FileSystemSqlFileProvider;
|
||||
import org.nanoboot.dbmigration.core.resources.ResourcesSqlFileProvider;
|
||||
import org.nanoboot.dbmigration.core.resources.SqlFileVersion;
|
||||
import org.nanoboot.powerframework.time.duration.StopWatch;
|
||||
import org.nanoboot.powerframework.time.moment.UniversalDateTime;
|
||||
import org.nanoboot.powerframework.time.utils.TimeUnit;
|
||||
import com.robertvokac.dbmigration.core.configuration.Configuration;
|
||||
import com.robertvokac.dbmigration.core.configuration.ConfigurationEntry;
|
||||
import com.robertvokac.dbmigration.core.configuration.ConfigurationKeys;
|
||||
import com.robertvokac.dbmigration.core.entity.DBMigrationSchemaHistory;
|
||||
import com.robertvokac.dbmigration.core.resources.SqlFile;
|
||||
import com.robertvokac.dbmigration.core.persistence.api.DBMigrationPersistence;
|
||||
import com.robertvokac.dbmigration.core.query.DBMigrationSchemaHistoryTable;
|
||||
import com.robertvokac.dbmigration.core.resources.FileSystemSqlFileProvider;
|
||||
import com.robertvokac.dbmigration.core.resources.ResourcesSqlFileProvider;
|
||||
import com.robertvokac.dbmigration.core.resources.SqlFileVersion;
|
||||
import com.robertvokac.powerframework.time.duration.StopWatch;
|
||||
import com.robertvokac.powerframework.time.moment.UniversalDateTime;
|
||||
import com.robertvokac.powerframework.time.utils.TimeUnit;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public class DBMigration {
|
||||
@ -109,7 +110,7 @@ public class DBMigration {
|
||||
private final Configuration configuration;
|
||||
private final DBMigrationPersistence persistence;
|
||||
|
||||
//validate -datasource.jdbc-url=jdbc:sqlite:/home/robertvokac/Desktop/test.sqlite3 -name=testDev -sql-dialect=sqlite -sql-migrations-directory=/home/robertvokac/Desktop/testDev/ -installed-by=robertvokac -sql-dialect-impl-class=org.nanoboot.dbmigration.persistence.impl.sqlite.DBMigrationPersistenceSqliteImpl
|
||||
//validate -datasource.jdbc-url=jdbc:sqlite:/home/robertvokac/Desktop/test.sqlite3 -name=testDev -sql-dialect=sqlite -sql-migrations-directory=/home/robertvokac/Desktop/testDev/ -installed-by=robertvokac -sql-dialect-impl-class=com.robertvokac.dbmigration.persistence.impl.sqlite.DBMigrationPersistenceSqliteImpl
|
||||
public static void main(String[] args) {
|
||||
LOG.info("*** DB Migration ***");
|
||||
LOG.info("DB Migration main static method has just started.");
|
||||
@ -132,11 +133,11 @@ public class DBMigration {
|
||||
configuration.addAndAddPrefixIfNeeded(ConfigurationEntry.ofArgument(arg));
|
||||
}
|
||||
DBMigration dBMigration = new DBMigration(configuration);
|
||||
//info -datasource.jdbc-url=jdbc:sqlite:/home/robertvokac/Desktop/test.sqlite3 -name=testDev -sql-dialect=sqlite -sql-migrations-directory=/home/robertvokac/Desktop/testDev/ -installed-by=robertvokac -sql-dialect-impl-class=org.nanoboot.dbmigration.core.persistence.impl.sqlite.DBMigrationPersistenceSqliteImpl
|
||||
//info -datasource.jdbc-url=jdbc:sqlite:/home/robertvokac/Desktop/test.sqlite3 -name=testDev -sql-dialect=sqlite -sql-migrations-directory=/home/robertvokac/Desktop/testDev/ -installed-by=robertvokac -sql-dialect-impl-class=com.robertvokac.dbmigration.core.persistence.impl.sqlite.DBMigrationPersistenceSqliteImpl
|
||||
// DBMigration dBMigration = DBMigration.configure()
|
||||
// .dataSource("jdbc:sqlite:/home/robertvokac/Desktop/test.sqlite3")
|
||||
// .name("testDev")
|
||||
// .sqlDialect("sqlite", "org.nanoboot.dbmigration.persistence.impl.sqlite.DBMigrationPersistenceSqliteImpl")
|
||||
// .sqlDialect("sqlite", "com.robertvokac.dbmigration.persistence.impl.sqlite.DBMigrationPersistenceSqliteImpl")
|
||||
// .sqlMigrationsDirectory("/home/robertvokac/Desktop/testDev/")
|
||||
// .installedBy("robertvokac")
|
||||
// .load();
|
@ -0,0 +1,44 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.robertvokac.dbmigration.core.main;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public class DBMigrationException extends RuntimeException {
|
||||
|
||||
public DBMigrationException(String msg, Exception ex) {
|
||||
super(msg, ex);
|
||||
}
|
||||
|
||||
public DBMigrationException(String msg) {
|
||||
super(msg);
|
||||
}
|
||||
|
||||
public DBMigrationException(Exception ex) {
|
||||
super(ex);
|
||||
}
|
||||
|
||||
}
|
@ -17,11 +17,11 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.main;
|
||||
package com.robertvokac.dbmigration.core.main;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public enum DBMigrationTarget {
|
@ -0,0 +1,31 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.robertvokac.dbmigration.core.main;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public enum MigrationResult {
|
||||
SUCCESS, FAILURE;
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.robertvokac.dbmigration.core.main;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public enum MigrationType {
|
||||
SQL, JAVA;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.robertvokac.dbmigration.core.main;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public enum RepairResult {
|
||||
SUCCESS, FAILURE;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.robertvokac.dbmigration.core.main;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public class SqlMigration {
|
||||
|
||||
}
|
@ -2,30 +2,31 @@
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// version 2.1 of the License only.
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.persistence.api;
|
||||
package com.robertvokac.dbmigration.core.persistence.api;
|
||||
|
||||
import java.util.List;
|
||||
import org.nanoboot.dbmigration.core.configuration.Configuration;
|
||||
import org.nanoboot.dbmigration.core.entity.DBMigrationSchemaHistory;
|
||||
import com.robertvokac.dbmigration.core.configuration.Configuration;
|
||||
import com.robertvokac.dbmigration.core.entity.DBMigrationSchemaHistory;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public interface DBMigrationPersistence {
|
@ -2,22 +2,23 @@
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// version 2.1 of the License only.
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.persistence.impl.base;
|
||||
package com.robertvokac.dbmigration.core.persistence.impl.base;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
@ -32,17 +33,17 @@ import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.nanoboot.dbmigration.core.configuration.Configuration;
|
||||
import org.nanoboot.dbmigration.core.entity.DBMigrationSchemaHistory;
|
||||
import org.nanoboot.dbmigration.core.main.DBMigrationException;
|
||||
import org.nanoboot.dbmigration.core.main.MigrationType;
|
||||
import org.nanoboot.dbmigration.core.persistence.api.DBMigrationPersistence;
|
||||
import org.nanoboot.dbmigration.core.persistence.impl.sqlite.DBMigrationPersistenceSqliteImpl;
|
||||
import org.nanoboot.dbmigration.core.query.DBMigrationSchemaHistoryTable;
|
||||
import com.robertvokac.dbmigration.core.configuration.Configuration;
|
||||
import com.robertvokac.dbmigration.core.entity.DBMigrationSchemaHistory;
|
||||
import com.robertvokac.dbmigration.core.main.DBMigrationException;
|
||||
import com.robertvokac.dbmigration.core.main.MigrationType;
|
||||
import com.robertvokac.dbmigration.core.persistence.api.DBMigrationPersistence;
|
||||
import com.robertvokac.dbmigration.core.persistence.impl.sqlite.DBMigrationPersistenceSqliteImpl;
|
||||
import com.robertvokac.dbmigration.core.query.DBMigrationSchemaHistoryTable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public abstract class DBMigrationPersistenceBase implements DBMigrationPersistence {
|
@ -2,34 +2,35 @@
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// version 2.1 of the License only.
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.persistence.impl.sqlite;
|
||||
package com.robertvokac.dbmigration.core.persistence.impl.sqlite;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.util.List;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.nanoboot.dbmigration.core.entity.DBMigrationSchemaHistory;
|
||||
import org.nanoboot.dbmigration.core.persistence.impl.base.DBMigrationPersistenceBase;
|
||||
import org.nanoboot.dbmigration.core.query.DBMigrationSchemaHistoryTable;
|
||||
import org.nanoboot.dbmigration.core.persistence.api.DBMigrationPersistence;
|
||||
import com.robertvokac.dbmigration.core.entity.DBMigrationSchemaHistory;
|
||||
import com.robertvokac.dbmigration.core.persistence.impl.base.DBMigrationPersistenceBase;
|
||||
import com.robertvokac.dbmigration.core.query.DBMigrationSchemaHistoryTable;
|
||||
import com.robertvokac.dbmigration.core.persistence.api.DBMigrationPersistence;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public class DBMigrationPersistenceSqliteImpl extends DBMigrationPersistenceBase implements DBMigrationPersistence {
|
@ -2,26 +2,27 @@
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// version 2.1 of the License only.
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.query;
|
||||
package com.robertvokac.dbmigration.core.query;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public class DBMigrationSchemaHistoryTable {
|
@ -2,34 +2,35 @@
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// version 2.1 of the License only.
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.resources;
|
||||
package com.robertvokac.dbmigration.core.resources;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.nanoboot.dbmigration.core.main.DBMigrationException;
|
||||
import static org.nanoboot.dbmigration.core.utils.DBMigrationUtils.readTextFromFile;
|
||||
import com.robertvokac.dbmigration.core.main.DBMigrationException;
|
||||
import static com.robertvokac.dbmigration.core.utils.DBMigrationUtils.readTextFromFile;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public final class FileSystemSqlFileProvider implements SqlFileProvider {
|
@ -2,22 +2,23 @@
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// version 2.1 of the License only.
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.resources;
|
||||
package com.robertvokac.dbmigration.core.resources;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
@ -37,12 +38,12 @@ import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.nanoboot.dbmigration.core.main.DBMigrationException;
|
||||
import org.nanoboot.dbmigration.core.utils.DBMigrationConstants;
|
||||
import com.robertvokac.dbmigration.core.main.DBMigrationException;
|
||||
import com.robertvokac.dbmigration.core.utils.DBMigrationConstants;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public final class ResourcesSqlFileProvider implements SqlFileProvider {
|
@ -2,29 +2,30 @@
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// version 2.1 of the License only.
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.resources;
|
||||
package com.robertvokac.dbmigration.core.resources;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nanoboot.dbmigration.core.utils.DBMigrationUtils;
|
||||
import com.robertvokac.dbmigration.core.utils.DBMigrationUtils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
@Data
|
@ -2,34 +2,35 @@
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// version 2.1 of the License only.
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.resources;
|
||||
package com.robertvokac.dbmigration.core.resources;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.ToString;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.nanoboot.dbmigration.core.main.DBMigrationException;
|
||||
import org.nanoboot.dbmigration.core.utils.DBMigrationUtils;
|
||||
import com.robertvokac.dbmigration.core.main.DBMigrationException;
|
||||
import com.robertvokac.dbmigration.core.utils.DBMigrationUtils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
@EqualsAndHashCode
|
@ -0,0 +1,38 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.robertvokac.dbmigration.core.resources;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public interface SqlFileProvider {
|
||||
|
||||
List<SqlFile> provide(String path, Class<?> clazz);
|
||||
|
||||
default List<SqlFile> provide(String path) {
|
||||
return provide(path, null);
|
||||
}
|
||||
|
||||
}
|
@ -2,22 +2,23 @@
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// version 2.1 of the License only.
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.resources;
|
||||
package com.robertvokac.dbmigration.core.resources;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
@ -26,7 +27,7 @@ import org.apache.logging.log4j.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
@EqualsAndHashCode
|
@ -17,11 +17,11 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.utils;
|
||||
package com.robertvokac.dbmigration.core.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public class DBMigrationConstants {
|
@ -17,7 +17,7 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.utils;
|
||||
package com.robertvokac.dbmigration.core.utils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
@ -25,14 +25,14 @@ import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import org.nanoboot.powerframework.security.hash.locator.HashCalculatorLocator;
|
||||
import com.robertvokac.powerframework.security.hash.locator.HashCalculatorLocator;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import org.nanoboot.dbmigration.core.main.DBMigrationException;
|
||||
import org.nanoboot.powerframework.security.hash.locator.HashImpl;
|
||||
import com.robertvokac.dbmigration.core.main.DBMigrationException;
|
||||
import com.robertvokac.powerframework.security.hash.locator.HashImpl;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public class DBMigrationUtils {
|
@ -19,11 +19,11 @@
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
module dbmigration.core {
|
||||
requires org.flywaydb.core;
|
||||
//requires org.flywaydb.core;
|
||||
requires lombok;
|
||||
requires java.sql;
|
||||
requires powerframework.time;
|
||||
@ -31,5 +31,5 @@ module dbmigration.core {
|
||||
requires powerframework.security;
|
||||
requires org.apache.logging.log4j;
|
||||
requires org.apache.logging.log4j.core;
|
||||
exports org.nanoboot.dbmigration.core.main;
|
||||
exports com.robertvokac.dbmigration.core.main;
|
||||
}
|
||||
|
@ -1,43 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// version 2.1 of the License only.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.main;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public class DBMigrationException extends RuntimeException {
|
||||
|
||||
public DBMigrationException(String msg, Exception ex) {
|
||||
super(msg, ex);
|
||||
}
|
||||
|
||||
public DBMigrationException(String msg) {
|
||||
super(msg);
|
||||
}
|
||||
|
||||
public DBMigrationException(Exception ex) {
|
||||
super(ex);
|
||||
}
|
||||
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// version 2.1 of the License only.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.main;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public enum MigrationResult {
|
||||
SUCCESS, FAILURE;
|
||||
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// version 2.1 of the License only.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.main;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public enum MigrationType {
|
||||
SQL, JAVA;
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// version 2.1 of the License only.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.main;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public enum RepairResult {
|
||||
SUCCESS, FAILURE;
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// version 2.1 of the License only.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.main;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public class SqlMigration {
|
||||
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// version 2.1 of the License only.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.resources;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public interface SqlFileProvider {
|
||||
|
||||
List<SqlFile> provide(String path, Class<?> clazz);
|
||||
|
||||
default List<SqlFile> provide(String path) {
|
||||
return provide(path, null);
|
||||
}
|
||||
|
||||
}
|
@ -17,7 +17,7 @@
|
||||
</File>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<Logger name="org.nanoboot.dbmigration" level="debug" additivity="false">
|
||||
<Logger name="com.robertvokac.dbmigration" level="debug" additivity="false">
|
||||
<AppenderRef ref="File"/>
|
||||
<AppenderRef ref="Console"/>
|
||||
</Logger>
|
||||
|
@ -17,7 +17,7 @@
|
||||
</File>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<Logger name="org.nanoboot.dbmigration" level="debug" additivity="false">
|
||||
<Logger name="com.robertvokac.dbmigration" level="debug" additivity="false">
|
||||
<AppenderRef ref="File"/>
|
||||
<AppenderRef ref="Console"/>
|
||||
</Logger>
|
||||
|
@ -17,9 +17,9 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.configuration;
|
||||
package com.robertvokac.dbmigration.core.configuration;
|
||||
|
||||
import org.nanoboot.dbmigration.core.main.DBMigrationException;
|
||||
import com.robertvokac.dbmigration.core.main.DBMigrationException;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
@ -29,7 +29,7 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public class ConfigurationEntryTest {
|
@ -17,11 +17,11 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.configuration;
|
||||
package com.robertvokac.dbmigration.core.configuration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.nanoboot.dbmigration.core.main.DBMigrationException;
|
||||
import com.robertvokac.dbmigration.core.main.DBMigrationException;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
@ -31,7 +31,7 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public class ConfigurationTest {
|
@ -17,13 +17,13 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.entity;
|
||||
package com.robertvokac.dbmigration.core.entity;
|
||||
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.net.ssl.KeyManagerFactory;
|
||||
import org.nanoboot.dbmigration.core.main.DBMigrationException;
|
||||
import com.robertvokac.dbmigration.core.main.DBMigrationException;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
@ -33,7 +33,7 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public class DBMigrationSchemaHistoryTest {
|
@ -17,13 +17,13 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.resources;
|
||||
package com.robertvokac.dbmigration.core.resources;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import org.nanoboot.dbmigration.core.main.DBMigrationException;
|
||||
import static org.nanoboot.dbmigration.core.utils.DBMigrationUtils.writeToFile;
|
||||
import com.robertvokac.dbmigration.core.main.DBMigrationException;
|
||||
import static com.robertvokac.dbmigration.core.utils.DBMigrationUtils.writeToFile;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
@ -33,7 +33,7 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public class FileSystemSqlFileProviderTest {
|
@ -17,10 +17,10 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.resources;
|
||||
package com.robertvokac.dbmigration.core.resources;
|
||||
|
||||
import java.util.List;
|
||||
import org.nanoboot.dbmigration.core.main.DBMigrationException;
|
||||
import com.robertvokac.dbmigration.core.main.DBMigrationException;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public class ResourcesSqlFileProviderTest {
|
||||
@ -95,7 +95,7 @@ public class ResourcesSqlFileProviderTest {
|
||||
System.out.println("provide(String,Class)");
|
||||
//prepare
|
||||
String path = ResourcesSqlFileProvider.createPath("sqlite", "test");
|
||||
Class clazz = org.nanoboot.dbmigration.test.jar.DBMigrationTestJarDummyClass.class;
|
||||
Class clazz = com.robertvokac.dbmigration.test.jar.DBMigrationTestJarDummyClass.class;
|
||||
ResourcesSqlFileProvider instance = new ResourcesSqlFileProvider();
|
||||
List<SqlFile> expResult = null;
|
||||
//execute
|
@ -17,19 +17,19 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.resources;
|
||||
package com.robertvokac.dbmigration.core.resources;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import org.nanoboot.dbmigration.core.main.DBMigrationException;
|
||||
import org.nanoboot.dbmigration.core.entity.DBMigrationSchemaHistory;
|
||||
import com.robertvokac.dbmigration.core.main.DBMigrationException;
|
||||
import com.robertvokac.dbmigration.core.entity.DBMigrationSchemaHistory;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public class SqlFileNameTest {
|
@ -17,7 +17,7 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.resources;
|
||||
package com.robertvokac.dbmigration.core.resources;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public class SqlFileProviderTest {
|
@ -17,9 +17,9 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.resources;
|
||||
package com.robertvokac.dbmigration.core.resources;
|
||||
|
||||
import org.nanoboot.dbmigration.core.main.DBMigrationException;
|
||||
import com.robertvokac.dbmigration.core.main.DBMigrationException;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
@ -29,7 +29,7 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public class SqlFileTest {
|
@ -17,7 +17,7 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.core.utils;
|
||||
package com.robertvokac.dbmigration.core.utils;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Modifier;
|
||||
@ -31,7 +31,7 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public class DBMigrationUtilsTest {
|
@ -23,12 +23,12 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.nanoboot.tools.dbmigration</groupId>
|
||||
<groupId>com.robertvokac.tools.dbmigration</groupId>
|
||||
<artifactId>db-migration</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.nanoboot.tools.dbmigration</groupId>
|
||||
<groupId>com.robertvokac.tools.dbmigration</groupId>
|
||||
<artifactId>db-migration-test-jar</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
@ -153,17 +153,17 @@
|
||||
</dependency>
|
||||
<!-- Power dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.nanoboot.powerframework</groupId>
|
||||
<groupId>com.robertvokac.powerframework</groupId>
|
||||
<artifactId>power-time</artifactId>
|
||||
<version>${power.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.nanoboot.powerframework</groupId>
|
||||
<groupId>com.robertvokac.powerframework</groupId>
|
||||
<artifactId>power-core</artifactId>
|
||||
<version>${power.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.nanoboot.powerframework</groupId>
|
||||
<groupId>com.robertvokac.powerframework</groupId>
|
||||
<artifactId>power-security</artifactId>
|
||||
<version>${power.version}</version>
|
||||
</dependency>
|
||||
|
@ -0,0 +1,30 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation, either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.robertvokac.dbmigration.test.jar;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public class DBMigrationTestJarDummyClass {
|
||||
|
||||
}
|
@ -19,7 +19,7 @@
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @author <a href="mailto:robertvokac@robertvokac.com">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
module dbmigration.testjar {
|
||||
@ -31,5 +31,5 @@ module dbmigration.testjar {
|
||||
requires powerframework.security;
|
||||
requires org.apache.logging.log4j;
|
||||
requires org.apache.logging.log4j.core;
|
||||
exports org.nanoboot.dbmigration.test.jar;
|
||||
exports com.robertvokac.dbmigration.test.jar;
|
||||
}
|
||||
|
@ -1,29 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// db-migration: A database schema versioning tool.
|
||||
// Copyright (C) 2021-2022 the original author or authors.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// version 2.1 of the License only.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package org.nanoboot.dbmigration.test.jar;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:robertvokac@nanoboot.org">Robert Vokac</a>
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public class DBMigrationTestJarDummyClass {
|
||||
|
||||
}
|
40
pom.xml
40
pom.xml
@ -23,24 +23,24 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.nanoboot.essential</groupId>
|
||||
<artifactId>nanoboot-parent</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<groupId>com.robertvokac.essential</groupId>
|
||||
<artifactId>robertvokac-parent</artifactId>
|
||||
<version>0.1.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.nanoboot.tools.dbmigration</groupId>
|
||||
<groupId>com.robertvokac.tools.dbmigration</groupId>
|
||||
<artifactId>db-migration</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.1-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>DB Migration</name>
|
||||
<description>Tool migrating databases versions.</description>
|
||||
|
||||
<properties>
|
||||
<dbmigration.version>0.1.0</dbmigration.version>
|
||||
<dbmigration.version>0.1.1-SNAPSHOT</dbmigration.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<checkstyle.skip>true</checkstyle.skip><!-- TODO: make false-->
|
||||
<power.version>2.0.0</power.version>
|
||||
<power.version>2.0.1-SNAPSHOT</power.version>
|
||||
</properties>
|
||||
<modules>
|
||||
<module>db-migration-core</module>
|
||||
@ -65,4 +65,30 @@
|
||||
|
||||
</dependencies>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>robertvokac-releases-repository</id>
|
||||
<name>robertvokac-releases-repository</name>
|
||||
<url>https://maven.robertvokac.com/releases</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>robertvokac-snapshots-repository</id>
|
||||
<name>robertvokac-snapshots-repository</name>
|
||||
<url>https://maven.robertvokac.com/snapshots</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>robertvokac-releases-repository</id>
|
||||
<name>robertvokac-releases-repository</name>
|
||||
<url>https://maven.robertvokac.com/releases</url>
|
||||
</pluginRepository>
|
||||
<pluginRepository>
|
||||
<id>robertvokac-snapshots-repository</id>
|
||||
<name>robertvokac-snapshots-repository</name>
|
||||
<url>https://maven.robertvokac.com/snapshots</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
</project>
|
||||
|
6
test.sh
6
test.sh
@ -3,13 +3,13 @@ cd ./db-migration-core/target&& \
|
||||
java \
|
||||
-cp "db-migration-core-0.0.0-SNAPSHOT-jar-with-dependencies.jar:../../db-migration-test-jar/target/db-migration-test-jar-0.0.0-SNAPSHOT.jar" \
|
||||
--module-path "db-migration-core-0.0.0-SNAPSHOT-jar-with-dependencies.jar:../../db-migration-test-jar/target/db-migration-test-jar-0.0.0-SNAPSHOT.jar" \
|
||||
org.nanoboot.dbmigration.core.main.DBMigration \
|
||||
com.robertvokac.dbmigration.core.main.DBMigration \
|
||||
migrate \
|
||||
-datasource.jdbc-url=jdbc:sqlite:/home/robertvokac/Desktop/test.sqlite3 \
|
||||
-name=test -sql-dialect=sqlite \
|
||||
-sql-migrations-directory=/home/robertvokac/Desktop/testDev/ \
|
||||
-installed-by=robertvokac \
|
||||
-sql-dialect-impl-class=org.nanoboot.dbmigration.core.persistence.impl.sqlite.DBMigrationPersistenceSqliteImpl \
|
||||
-sql-dialect-impl-class=com.robertvokac.dbmigration.core.persistence.impl.sqlite.DBMigrationPersistenceSqliteImpl \
|
||||
&&cd ../..
|
||||
|
||||
#org.nanoboot.dbmigration.test.jar.DBMigrationTestJarDummyClass
|
||||
#com.robertvokac.dbmigration.test.jar.DBMigrationTestJarDummyClass
|
||||
|
Reference in New Issue
Block a user