Migrated to GPL v3 and robertvokac.com

This commit is contained in:
Robert Vokac 2024-10-13 12:29:03 +02:00
parent 2622f0b6cf
commit 1add28e475
Signed by: robertvokac
GPG Key ID: FB9CE8E20AADA55F
50 changed files with 1128 additions and 935 deletions

View File

@ -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

1016
LICENSE

File diff suppressed because it is too large Load Diff

View File

@ -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.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>
@ -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>

View File

@ -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 {

View File

@ -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

View File

@ -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 {

View File

@ -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

View File

@ -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();

View File

@ -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);
}
}

View File

@ -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 {

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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 {
}

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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

View File

@ -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

View File

@ -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);
}
}

View File

@ -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

View File

@ -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 {

View File

@ -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 {

View File

@ -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.core {
@ -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;
}

View File

@ -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);
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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 {
}

View File

@ -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);
}
}

View File

@ -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>

View File

@ -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>

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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.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>

View File

@ -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 {
}

View File

@ -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;
}

View File

@ -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 {
}

34
pom.xml
View File

@ -23,12 +23,12 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.nanoboot.essential</groupId>
<artifactId>nanoboot-parent</artifactId>
<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.1-SNAPSHOT</version>
<packaging>pom</packaging>
@ -65,29 +65,29 @@
</dependencies>
<repositories>
<repositories>
<repository>
<id>releases</id>
<name>nanoboot-releases-repository</name>
<url>https://maven.nanoboot.org/releases</url>
<id>robertvokac-releases-repository</id>
<name>robertvokac-releases-repository</name>
<url>https://maven.robertvokac.com/releases</url>
</repository>
<repository>
<id>snapshots</id>
<name>nanoboot-snapshots-repository</name>
<url>https://maven.nanoboot.org/snapshots</url>
<id>robertvokac-snapshots-repository</id>
<name>robertvokac-snapshots-repository</name>
<url>https://maven.robertvokac.com/snapshots</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepositories>
<pluginRepository>
<id>releases</id>
<name>nanoboot-releases-repository</name>
<url>https://maven.nanoboot.org/releases</url>
<id>robertvokac-releases-repository</id>
<name>robertvokac-releases-repository</name>
<url>https://maven.robertvokac.com/releases</url>
</pluginRepository>
<pluginRepository>
<id>snapshots</id>
<name>nanoboot-snapshots-repository</name>
<url>https://maven.nanoboot.org/snapshots</url>
<id>robertvokac-snapshots-repository</id>
<name>robertvokac-snapshots-repository</name>
<url>https://maven.robertvokac.com/snapshots</url>
</pluginRepository>
</pluginRepositories>

View File

@ -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