From f14c87d5b9315fc11a7071df30fa8e4c3024b18b Mon Sep 17 00:00:00 2001 From: Oliver Stahl Date: Tue, 22 Aug 2023 10:45:40 +0200 Subject: [PATCH 1/2] Added support for cache and iris database --- flyway-community-db-support/pom.xml | 11 +++ .../intersystems/cache/CacheConnection.java | 44 +++++++++ .../intersystems/cache/CacheDatabase.java | 98 +++++++++++++++++++ .../intersystems/cache/CacheDatabaseType.java | 69 +++++++++++++ .../intersystems/cache/CacheParser.java | 33 +++++++ .../intersystems/cache/CacheSchema.java | 87 ++++++++++++++++ .../intersystems/cache/CacheTable.java | 65 ++++++++++++ .../intersystems/iris/IrisConnection.java | 44 +++++++++ .../intersystems/iris/IrisDatabase.java | 98 +++++++++++++++++++ .../intersystems/iris/IrisDatabaseType.java | 69 +++++++++++++ .../intersystems/iris/IrisParser.java | 33 +++++++ .../intersystems/iris/IrisSchema.java | 87 ++++++++++++++++ .../database/intersystems/iris/IrisTable.java | 65 ++++++++++++ .../org.flywaydb.core.extensibility.Plugin | 2 + pom.xml | 16 +++ 15 files changed, 821 insertions(+) create mode 100644 flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheConnection.java create mode 100644 flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheDatabase.java create mode 100644 flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheDatabaseType.java create mode 100644 flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheParser.java create mode 100644 flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheSchema.java create mode 100644 flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheTable.java create mode 100644 flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisConnection.java create mode 100644 flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisDatabase.java create mode 100644 flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisDatabaseType.java create mode 100644 flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisParser.java create mode 100644 flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisSchema.java create mode 100644 flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisTable.java diff --git a/flyway-community-db-support/pom.xml b/flyway-community-db-support/pom.xml index 38a90228fb..8a434feec9 100644 --- a/flyway-community-db-support/pom.xml +++ b/flyway-community-db-support/pom.xml @@ -51,6 +51,17 @@ ignite-core true + + + com.intersys + cache-jdbc + + + + + com.intersys + iris-jdbc + diff --git a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheConnection.java b/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheConnection.java new file mode 100644 index 0000000000..50dd3dbdac --- /dev/null +++ b/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheConnection.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) Red Gate Software Ltd 2010-2023 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.flywaydb.community.database.intersystems.cache; + +import java.sql.SQLException; + +import org.flywaydb.core.internal.database.base.Connection; + +/** + * @author Oliver Stahl + */ +public class CacheConnection extends Connection +{ + + protected CacheConnection(CacheDatabase database, java.sql.Connection connection) + { + super(database, connection); + } + + @Override + protected String getCurrentSchemaNameOrSearchPath() throws SQLException + { + return "SQLUser"; + } + + @Override + public CacheSchema getSchema(String name) + { + return new CacheSchema(jdbcTemplate, database, name); + } +} \ No newline at end of file diff --git a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheDatabase.java b/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheDatabase.java new file mode 100644 index 0000000000..d76772835c --- /dev/null +++ b/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheDatabase.java @@ -0,0 +1,98 @@ +/* + * Copyright (C) Red Gate Software Ltd 2010-2023 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.flywaydb.community.database.intersystems.cache; + +import java.sql.Connection; + +import org.flywaydb.core.api.configuration.Configuration; +import org.flywaydb.core.internal.database.base.Database; +import org.flywaydb.core.internal.database.base.Table; +import org.flywaydb.core.internal.jdbc.JdbcConnectionFactory; +import org.flywaydb.core.internal.jdbc.StatementInterceptor; + +/** + * @author Oliver Stahl + */ +public class CacheDatabase extends Database +{ + + public CacheDatabase(Configuration configuration, JdbcConnectionFactory jdbcConnectionFactory, StatementInterceptor statementInterceptor) + { + super(configuration, jdbcConnectionFactory, statementInterceptor); + } + + @Override + protected CacheConnection doGetConnection(Connection connection) + { + return new CacheConnection(this, connection); + } + + @Override + public void ensureSupported() + { + ensureDatabaseIsRecentEnough("2014.1"); + } + + @Override + public boolean supportsDdlTransactions() + { + return true; + } + + @Override + public String getBooleanTrue() + { + return "1"; + } + + @Override + public String getBooleanFalse() + { + return "0"; + } + + @Override + public String doQuote(String identifier) { + return "\"" + identifier + "\""; + } + + @Override + public boolean catalogIsSchema() + { + return false; + } + + @Override + public String getRawCreateScript(Table table, boolean baseline) + { + return "CREATE TABLE " + table + " (\n" + + " \"installed_rank\" INT NOT NULL,\n" + + " \"version\" VARCHAR(50),\n" + + " \"description\" VARCHAR(200) NOT NULL,\n" + + " \"type\" VARCHAR(20) NOT NULL,\n" + + " \"script\" VARCHAR(1000) NOT NULL,\n" + + " \"checksum\" INTEGER,\n" + + " \"installed_by\" VARCHAR(100) NOT NULL,\n" + + " \"installed_on\" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n" + + " \"execution_time\" INTEGER NOT NULL,\n" + + " \"success\" BIT NOT NULL\n" + + ");\n" + + (baseline ? getBaselineStatement(table) + ";\n" : "") + + "ALTER TABLE " + table + " ADD CONSTRAINT \"" + table.getName() + "_pk\" PRIMARY KEY (\"installed_rank\");\n" + + "CREATE INDEX \"" + table.getName() + "_s_idx\" ON " + table + " (\"success\");"; + } + +} \ No newline at end of file diff --git a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheDatabaseType.java b/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheDatabaseType.java new file mode 100644 index 0000000000..0bb4f3e8be --- /dev/null +++ b/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheDatabaseType.java @@ -0,0 +1,69 @@ +/* + * Copyright (C) Red Gate Software Ltd 2010-2023 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.flywaydb.community.database.intersystems.cache; + +import java.sql.Connection; +import java.sql.Types; + +import org.flywaydb.core.api.ResourceProvider; +import org.flywaydb.core.api.configuration.Configuration; +import org.flywaydb.core.internal.database.base.BaseDatabaseType; +import org.flywaydb.core.internal.jdbc.JdbcConnectionFactory; +import org.flywaydb.core.internal.jdbc.StatementInterceptor; +import org.flywaydb.core.internal.parser.Parser; +import org.flywaydb.core.internal.parser.ParsingContext; + +/** + * @author Oliver Stahl + */ +public class CacheDatabaseType extends BaseDatabaseType +{ + @Override + public String getName() { + return "InterSystems Caché"; + } + + @Override + public int getNullType() { + return Types.NULL; + } + + @Override + public boolean handlesJDBCUrl(String url) { + return url.startsWith("jdbc:Cache:"); + } + + @Override + public String getDriverClass(String url, ClassLoader classLoader) { + return "com.intersys.jdbc.CacheDriver"; + } + + @Override + public boolean handlesDatabaseProductNameAndVersion(String databaseProductName, String databaseProductVersion, Connection connection) { + return databaseProductName.startsWith("Cache"); + } + + @Override + public CacheDatabase createDatabase(Configuration configuration, JdbcConnectionFactory jdbcConnectionFactory, StatementInterceptor statementInterceptor) { + return new CacheDatabase(configuration, jdbcConnectionFactory, statementInterceptor); + } + + @Override + public Parser createParser(Configuration configuration, ResourceProvider resourceProvider, ParsingContext parsingContext) { + return new CacheParser(configuration, parsingContext, 3); + } + +} \ No newline at end of file diff --git a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheParser.java b/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheParser.java new file mode 100644 index 0000000000..92dfe57221 --- /dev/null +++ b/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheParser.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) Red Gate Software Ltd 2010-2023 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.flywaydb.community.database.intersystems.cache; + +import org.flywaydb.core.api.configuration.Configuration; +import org.flywaydb.core.internal.parser.Parser; +import org.flywaydb.core.internal.parser.ParsingContext; + +/** + * @author Oliver Stahl + */ +public class CacheParser extends Parser +{ + + protected CacheParser(Configuration configuration, ParsingContext parsingContext, int peekDepth) + { + super(configuration, parsingContext, peekDepth); + } + +} \ No newline at end of file diff --git a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheSchema.java b/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheSchema.java new file mode 100644 index 0000000000..0d907590e8 --- /dev/null +++ b/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheSchema.java @@ -0,0 +1,87 @@ +/* + * Copyright (C) Red Gate Software Ltd 2010-2023 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.flywaydb.community.database.intersystems.cache; + +import java.sql.SQLException; +import java.util.Collection; +import java.util.stream.Stream; + +import org.flywaydb.core.api.logging.Log; +import org.flywaydb.core.api.logging.LogFactory; +import org.flywaydb.core.internal.database.base.Schema; +import org.flywaydb.core.internal.database.base.Table; +import org.flywaydb.core.internal.jdbc.JdbcTemplate; + +/** + * @author Oliver Stahl + */ +public class CacheSchema extends Schema +{ + private static final Log LOG = LogFactory.getLog(CacheSchema.class); + + /** + * Creates a new Cache schema. + * + * @param jdbcTemplate The Jdbc Template for communicating with the DB. + * @param database The database-specific support. + * @param name The name of the schema. + */ + CacheSchema(JdbcTemplate jdbcTemplate, CacheDatabase database, String name) { + super(jdbcTemplate, database, name); + } + + @Override + protected boolean doExists() { + return true; // Schemas don't need to be created beforehand in Cach�; hence a schema always "exists". + } + + @Override + protected boolean doEmpty() throws SQLException { + return findAllTableNames().isEmpty(); + } + + @Override + protected void doCreate() { + LOG.debug("Schema '" + name + "' not created - Cache does not support creating schemas"); + } + + @Override + protected void doDrop() { + LOG.debug("Schema '" + name + "' not dropped - Cache does not support dropping schemas"); + } + + @Override + protected void doClean() { + Stream.of(allTables()).forEach(Table::drop); + } + + @Override + protected CacheTable[] doAllTables() throws SQLException { + return findAllTableNames().stream().map(this::getTable).toArray(CacheTable[]::new); + } + + @Override + public CacheTable getTable(String tableName) { + return new CacheTable(jdbcTemplate, database, this, tableName); + } + + private Collection findAllTableNames() throws SQLException { + return jdbcTemplate.queryForStringList( + "SELECT SqlTableName from %dictionary.compiledclass where SqlSchemaName = ?", + name + ); + } +} \ No newline at end of file diff --git a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheTable.java b/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheTable.java new file mode 100644 index 0000000000..de2b5e8480 --- /dev/null +++ b/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheTable.java @@ -0,0 +1,65 @@ +/* + * Copyright (C) Red Gate Software Ltd 2010-2023 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.flywaydb.community.database.intersystems.cache; + +import java.sql.SQLException; + +import org.flywaydb.core.internal.database.base.Table; +import org.flywaydb.core.internal.jdbc.JdbcTemplate; + +/** + * @author Oliver Stahl + */ +public class CacheTable extends Table +{ + /** + * Lock duration in seconds + */ + private static final Integer DURATION = 2; + + /** + * Creates a new Cache table. + * + * @param jdbcTemplate The Jdbc Template for communicating with the DB. + * @param database The database-specific support. + * @param schema The schema this table lives in. + * @param name The name of the table. + */ + CacheTable(JdbcTemplate jdbcTemplate, CacheDatabase database, CacheSchema schema, String name) + { + super(jdbcTemplate, database, schema, name); + } + + @Override + protected void doDrop() throws SQLException + { + jdbcTemplate.executeStatement("SET OPTION COMPILEMODE = NOCHECK"); + jdbcTemplate.executeStatement("DROP TABLE " + database.quote(schema.getName(), name) + " CASCADE"); + } + + @Override + protected boolean doExists() throws SQLException + { + return jdbcTemplate.queryForBoolean("SELECT DECODE((select 1 from %dictionary.compiledclass where SqlSchemaName = ? and SqlTableName = ?), 1, 1, 0)", schema.getName(), name); + } + + @Override + protected void doLock() throws SQLException + { + jdbcTemplate.executeStatement("LOCK TABLE " + database.quote(schema.getName(), name) + "IN EXCLUSIVE MODE WAIT " + DURATION); + } + +} \ No newline at end of file diff --git a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisConnection.java b/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisConnection.java new file mode 100644 index 0000000000..b188d10448 --- /dev/null +++ b/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisConnection.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) Red Gate Software Ltd 2010-2023 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.flywaydb.community.database.intersystems.iris; + +import java.sql.SQLException; + +import org.flywaydb.core.internal.database.base.Connection; + +/** + * @author Oliver Stahl + */ +public class IrisConnection extends Connection +{ + + protected IrisConnection(IrisDatabase database, java.sql.Connection connection) + { + super(database, connection); + } + + @Override + protected String getCurrentSchemaNameOrSearchPath() throws SQLException + { + return "SQLUser"; + } + + @Override + public IrisSchema getSchema(String name) + { + return new IrisSchema(jdbcTemplate, database, name); + } +} \ No newline at end of file diff --git a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisDatabase.java b/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisDatabase.java new file mode 100644 index 0000000000..71517e7551 --- /dev/null +++ b/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisDatabase.java @@ -0,0 +1,98 @@ +/* + * Copyright (C) Red Gate Software Ltd 2010-2023 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.flywaydb.community.database.intersystems.iris; + +import java.sql.Connection; + +import org.flywaydb.core.api.configuration.Configuration; +import org.flywaydb.core.internal.database.base.Database; +import org.flywaydb.core.internal.database.base.Table; +import org.flywaydb.core.internal.jdbc.JdbcConnectionFactory; +import org.flywaydb.core.internal.jdbc.StatementInterceptor; + +/** + * @author Oliver Stahl + */ +public class IrisDatabase extends Database +{ + + public IrisDatabase(Configuration configuration, JdbcConnectionFactory jdbcConnectionFactory, StatementInterceptor statementInterceptor) + { + super(configuration, jdbcConnectionFactory, statementInterceptor); + } + + @Override + protected IrisConnection doGetConnection(Connection connection) + { + return new IrisConnection(this, connection); + } + + @Override + public void ensureSupported() + { + ensureDatabaseIsRecentEnough("2019.1"); + } + + @Override + public boolean supportsDdlTransactions() + { + return true; + } + + @Override + public String getBooleanTrue() + { + return "1"; + } + + @Override + public String getBooleanFalse() + { + return "0"; + } + + @Override + public String doQuote(String identifier) { + return "\"" + identifier + "\""; + } + + @Override + public boolean catalogIsSchema() + { + return false; + } + + @Override + public String getRawCreateScript(Table table, boolean baseline) + { + return "CREATE TABLE " + table + " (\n" + + " \"installed_rank\" INT NOT NULL,\n" + + " \"version\" VARCHAR(50),\n" + + " \"description\" VARCHAR(200) NOT NULL,\n" + + " \"type\" VARCHAR(20) NOT NULL,\n" + + " \"script\" VARCHAR(1000) NOT NULL,\n" + + " \"checksum\" INTEGER,\n" + + " \"installed_by\" VARCHAR(100) NOT NULL,\n" + + " \"installed_on\" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n" + + " \"execution_time\" INTEGER NOT NULL,\n" + + " \"success\" BIT NOT NULL\n" + + ");\n" + + (baseline ? getBaselineStatement(table) + ";\n" : "") + + "ALTER TABLE " + table + " ADD CONSTRAINT \"" + table.getName() + "_pk\" PRIMARY KEY (\"installed_rank\");\n" + + "CREATE INDEX \"" + table.getName() + "_s_idx\" ON " + table + " (\"success\");"; + } + +} \ No newline at end of file diff --git a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisDatabaseType.java b/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisDatabaseType.java new file mode 100644 index 0000000000..7327264c01 --- /dev/null +++ b/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisDatabaseType.java @@ -0,0 +1,69 @@ +/* + * Copyright (C) Red Gate Software Ltd 2010-2023 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.flywaydb.community.database.intersystems.iris; + +import java.sql.Connection; +import java.sql.Types; + +import org.flywaydb.core.api.ResourceProvider; +import org.flywaydb.core.api.configuration.Configuration; +import org.flywaydb.core.internal.database.base.BaseDatabaseType; +import org.flywaydb.core.internal.jdbc.JdbcConnectionFactory; +import org.flywaydb.core.internal.jdbc.StatementInterceptor; +import org.flywaydb.core.internal.parser.Parser; +import org.flywaydb.core.internal.parser.ParsingContext; + +/** + * @author Oliver Stahl + */ +public class IrisDatabaseType extends BaseDatabaseType +{ + @Override + public String getName() { + return "InterSystems IRIS"; + } + + @Override + public int getNullType() { + return Types.NULL; + } + + @Override + public boolean handlesJDBCUrl(String url) { + return url.startsWith("jdbc:IRIS:"); + } + + @Override + public String getDriverClass(String url, ClassLoader classLoader) { + return "com.intersystems.jdbc.IRISDriver"; + } + + @Override + public boolean handlesDatabaseProductNameAndVersion(String databaseProductName, String databaseProductVersion, Connection connection) { + return databaseProductName.startsWith("InterSystems IRIS"); + } + + @Override + public IrisDatabase createDatabase(Configuration configuration, JdbcConnectionFactory jdbcConnectionFactory, StatementInterceptor statementInterceptor) { + return new IrisDatabase(configuration, jdbcConnectionFactory, statementInterceptor); + } + + @Override + public Parser createParser(Configuration configuration, ResourceProvider resourceProvider, ParsingContext parsingContext) { + return new IrisParser(configuration, parsingContext, 3); + } + +} \ No newline at end of file diff --git a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisParser.java b/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisParser.java new file mode 100644 index 0000000000..833183395c --- /dev/null +++ b/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisParser.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) Red Gate Software Ltd 2010-2023 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.flywaydb.community.database.intersystems.iris; + +import org.flywaydb.core.api.configuration.Configuration; +import org.flywaydb.core.internal.parser.Parser; +import org.flywaydb.core.internal.parser.ParsingContext; + +/** + * @author Oliver Stahl + */ +public class IrisParser extends Parser +{ + + protected IrisParser(Configuration configuration, ParsingContext parsingContext, int peekDepth) + { + super(configuration, parsingContext, peekDepth); + } + +} \ No newline at end of file diff --git a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisSchema.java b/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisSchema.java new file mode 100644 index 0000000000..e65d841605 --- /dev/null +++ b/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisSchema.java @@ -0,0 +1,87 @@ +/* + * Copyright (C) Red Gate Software Ltd 2010-2023 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.flywaydb.community.database.intersystems.iris; + +import java.sql.SQLException; +import java.util.Collection; +import java.util.stream.Stream; + +import org.flywaydb.core.api.logging.Log; +import org.flywaydb.core.api.logging.LogFactory; +import org.flywaydb.core.internal.database.base.Schema; +import org.flywaydb.core.internal.database.base.Table; +import org.flywaydb.core.internal.jdbc.JdbcTemplate; + +/** + * @author Oliver Stahl + */ +public class IrisSchema extends Schema +{ + private static final Log LOG = LogFactory.getLog(IrisSchema.class); + + /** + * Creates a new IRIS schema. + * + * @param jdbcTemplate The Jdbc Template for communicating with the DB. + * @param database The database-specific support. + * @param name The name of the schema. + */ + IrisSchema(JdbcTemplate jdbcTemplate, IrisDatabase database, String name) { + super(jdbcTemplate, database, name); + } + + @Override + protected boolean doExists() { + return true; // Schemas don't need to be created beforehand in Cach�; hence a schema always "exists". + } + + @Override + protected boolean doEmpty() throws SQLException { + return findAllTableNames().isEmpty(); + } + + @Override + protected void doCreate() { + LOG.debug("Schema '" + name + "' not created - IRIS does not support creating schemas"); + } + + @Override + protected void doDrop() { + LOG.debug("Schema '" + name + "' not dropped - IRIS does not support dropping schemas"); + } + + @Override + protected void doClean() { + Stream.of(allTables()).forEach(Table::drop); + } + + @Override + protected IrisTable[] doAllTables() throws SQLException { + return findAllTableNames().stream().map(this::getTable).toArray(IrisTable[]::new); + } + + @Override + public IrisTable getTable(String tableName) { + return new IrisTable(jdbcTemplate, database, this, tableName); + } + + private Collection findAllTableNames() throws SQLException { + return jdbcTemplate.queryForStringList( + "SELECT SqlTableName from %dictionary.compiledclass where SqlSchemaName = ?", + name + ); + } +} \ No newline at end of file diff --git a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisTable.java b/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisTable.java new file mode 100644 index 0000000000..05c01a30d2 --- /dev/null +++ b/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisTable.java @@ -0,0 +1,65 @@ +/* + * Copyright (C) Red Gate Software Ltd 2010-2023 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.flywaydb.community.database.intersystems.iris; + +import java.sql.SQLException; + +import org.flywaydb.core.internal.database.base.Table; +import org.flywaydb.core.internal.jdbc.JdbcTemplate; + +/** + * @author Oliver Stahl + */ +public class IrisTable extends Table +{ + /** + * Lock duration in seconds + */ + private static final Integer DURATION = 2; + + /** + * Creates a new Cache table. + * + * @param jdbcTemplate The Jdbc Template for communicating with the DB. + * @param database The database-specific support. + * @param schema The schema this table lives in. + * @param name The name of the table. + */ + IrisTable(JdbcTemplate jdbcTemplate, IrisDatabase database, IrisSchema schema, String name) + { + super(jdbcTemplate, database, schema, name); + } + + @Override + protected void doDrop() throws SQLException + { + jdbcTemplate.executeStatement("SET OPTION COMPILEMODE = NOCHECK"); + jdbcTemplate.executeStatement("DROP TABLE " + database.quote(schema.getName(), name) + " CASCADE"); + } + + @Override + protected boolean doExists() throws SQLException + { + return jdbcTemplate.queryForBoolean("SELECT DECODE((select 1 from %dictionary.compiledclass where SqlSchemaName = ? and SqlTableName = ?), 1, 1, 0)", schema.getName(), name); + } + + @Override + protected void doLock() throws SQLException + { + jdbcTemplate.executeStatement("LOCK TABLE " + database.quote(schema.getName(), name) + "IN EXCLUSIVE MODE WAIT " + DURATION); + } + +} \ No newline at end of file diff --git a/flyway-community-db-support/src/main/resources/META-INF/services/org.flywaydb.core.extensibility.Plugin b/flyway-community-db-support/src/main/resources/META-INF/services/org.flywaydb.core.extensibility.Plugin index 53193f5374..ea5b7110c0 100644 --- a/flyway-community-db-support/src/main/resources/META-INF/services/org.flywaydb.core.extensibility.Plugin +++ b/flyway-community-db-support/src/main/resources/META-INF/services/org.flywaydb.core.extensibility.Plugin @@ -2,3 +2,5 @@ org.flywaydb.community.database.ignite.thin.IgniteThinDatabaseType org.flywaydb.community.database.mysql.tidb.TiDBDatabaseType org.flywaydb.community.database.yugabytedb.YugabyteDBDatabaseType org.flywaydb.community.database.CommunityDatabaseExtension +org.flywaydb.community.database.intersystems.cache.CacheDatabaseType +org.flywaydb.community.database.intersystems.iris.IrisDatabaseType \ No newline at end of file diff --git a/pom.xml b/pom.xml index d4f5f152c7..474322893b 100644 --- a/pom.xml +++ b/pom.xml @@ -155,6 +155,8 @@ 2.2 2.7.1 2.13.0 + 2018.1.2 + 3.6.1 4.50.3 1.18 2.14.0 @@ -327,6 +329,20 @@ ${version.ignite} true + + + com.intersys + cache-jdbc + ${version.intersystems.cache} + true + + + + com.intersys + iris-jdbc + ${version.intersystems.iris} + true + com.singlestore singlestore-jdbc-client From 638bc9126b96b9f25072dbf3f2dbb3a0ea4e8ace Mon Sep 17 00:00:00 2001 From: Oliver Stahl Date: Fri, 12 Jan 2024 08:54:26 +0100 Subject: [PATCH 2/2] Fixed errors after rebasing --- .../flyway-database-cache/pom.xml | 60 +++++++++++++++++++ .../intersystems/cache/CacheConnection.java | 2 +- .../intersystems/cache/CacheDatabase.java | 4 +- .../intersystems/cache/CacheDatabaseType.java | 2 +- .../intersystems/cache/CacheParser.java | 2 +- .../intersystems/cache/CacheSchema.java | 2 +- .../intersystems/cache/CacheTable.java | 2 +- .../org.flywaydb.core.extensibility.Plugin | 1 + .../flyway-database-iris/pom.xml | 60 +++++++++++++++++++ .../intersystems/iris/IrisConnection.java | 2 +- .../intersystems/iris/IrisDatabase.java | 4 +- .../intersystems/iris/IrisDatabaseType.java | 2 +- .../intersystems/iris/IrisParser.java | 2 +- .../intersystems/iris/IrisSchema.java | 2 +- .../database/intersystems/iris/IrisTable.java | 2 +- .../org.flywaydb.core.extensibility.Plugin | 1 + flyway-community-db-support/pom.xml | 2 + .../org.flywaydb.core.extensibility.Plugin | 0 pom.xml | 5 ++ 19 files changed, 143 insertions(+), 14 deletions(-) create mode 100644 flyway-community-db-support/flyway-database-cache/pom.xml rename flyway-community-db-support/{ => flyway-database-cache}/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheConnection.java (96%) rename flyway-community-db-support/{ => flyway-database-cache}/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheDatabase.java (96%) rename flyway-community-db-support/{ => flyway-database-cache}/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheDatabaseType.java (97%) rename flyway-community-db-support/{ => flyway-database-cache}/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheParser.java (95%) rename flyway-community-db-support/{ => flyway-database-cache}/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheSchema.java (98%) rename flyway-community-db-support/{ => flyway-database-cache}/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheTable.java (97%) create mode 100644 flyway-community-db-support/flyway-database-cache/src/main/resources/META-INF/services/org.flywaydb.core.extensibility.Plugin create mode 100644 flyway-community-db-support/flyway-database-iris/pom.xml rename flyway-community-db-support/{ => flyway-database-iris}/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisConnection.java (96%) rename flyway-community-db-support/{ => flyway-database-iris}/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisDatabase.java (96%) rename flyway-community-db-support/{ => flyway-database-iris}/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisDatabaseType.java (97%) rename flyway-community-db-support/{ => flyway-database-iris}/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisParser.java (95%) rename flyway-community-db-support/{ => flyway-database-iris}/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisSchema.java (98%) rename flyway-community-db-support/{ => flyway-database-iris}/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisTable.java (97%) create mode 100644 flyway-community-db-support/flyway-database-iris/src/main/resources/META-INF/services/org.flywaydb.core.extensibility.Plugin delete mode 100644 flyway-community-db-support/src/main/resources/META-INF/services/org.flywaydb.core.extensibility.Plugin diff --git a/flyway-community-db-support/flyway-database-cache/pom.xml b/flyway-community-db-support/flyway-database-cache/pom.xml new file mode 100644 index 0000000000..981b21dbcc --- /dev/null +++ b/flyway-community-db-support/flyway-database-cache/pom.xml @@ -0,0 +1,60 @@ + + + + 4.0.0 + + org.flywaydb + flyway-community-db-support + 10.5.0 + + + flyway-database-cache + ${project.artifactId} + + + + ${project.groupId} + flyway-core + + + com.intersys + cache-jdbc + true + + + + + + + src/main/resources + true + + + + + maven-resources-plugin + + + maven-jar-plugin + + + + \ No newline at end of file diff --git a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheConnection.java b/flyway-community-db-support/flyway-database-cache/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheConnection.java similarity index 96% rename from flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheConnection.java rename to flyway-community-db-support/flyway-database-cache/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheConnection.java index 50dd3dbdac..117f2c92a6 100644 --- a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheConnection.java +++ b/flyway-community-db-support/flyway-database-cache/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (C) Red Gate Software Ltd 2010-2023 + * Copyright (C) Red Gate Software Ltd 2010-2024 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheDatabase.java b/flyway-community-db-support/flyway-database-cache/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheDatabase.java similarity index 96% rename from flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheDatabase.java rename to flyway-community-db-support/flyway-database-cache/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheDatabase.java index d76772835c..1865d05a56 100644 --- a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheDatabase.java +++ b/flyway-community-db-support/flyway-database-cache/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheDatabase.java @@ -1,5 +1,5 @@ /* - * Copyright (C) Red Gate Software Ltd 2010-2023 + * Copyright (C) Red Gate Software Ltd 2010-2024 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ protected CacheConnection doGetConnection(Connection connection) } @Override - public void ensureSupported() + public void ensureSupported(Configuration configuration) { ensureDatabaseIsRecentEnough("2014.1"); } diff --git a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheDatabaseType.java b/flyway-community-db-support/flyway-database-cache/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheDatabaseType.java similarity index 97% rename from flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheDatabaseType.java rename to flyway-community-db-support/flyway-database-cache/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheDatabaseType.java index 0bb4f3e8be..31a7c13e43 100644 --- a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheDatabaseType.java +++ b/flyway-community-db-support/flyway-database-cache/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheDatabaseType.java @@ -1,5 +1,5 @@ /* - * Copyright (C) Red Gate Software Ltd 2010-2023 + * Copyright (C) Red Gate Software Ltd 2010-2024 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheParser.java b/flyway-community-db-support/flyway-database-cache/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheParser.java similarity index 95% rename from flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheParser.java rename to flyway-community-db-support/flyway-database-cache/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheParser.java index 92dfe57221..edddbe94b9 100644 --- a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheParser.java +++ b/flyway-community-db-support/flyway-database-cache/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheParser.java @@ -1,5 +1,5 @@ /* - * Copyright (C) Red Gate Software Ltd 2010-2023 + * Copyright (C) Red Gate Software Ltd 2010-2024 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheSchema.java b/flyway-community-db-support/flyway-database-cache/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheSchema.java similarity index 98% rename from flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheSchema.java rename to flyway-community-db-support/flyway-database-cache/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheSchema.java index 0d907590e8..a21d206f67 100644 --- a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheSchema.java +++ b/flyway-community-db-support/flyway-database-cache/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheSchema.java @@ -1,5 +1,5 @@ /* - * Copyright (C) Red Gate Software Ltd 2010-2023 + * Copyright (C) Red Gate Software Ltd 2010-2024 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheTable.java b/flyway-community-db-support/flyway-database-cache/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheTable.java similarity index 97% rename from flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheTable.java rename to flyway-community-db-support/flyway-database-cache/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheTable.java index de2b5e8480..9878a83c59 100644 --- a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheTable.java +++ b/flyway-community-db-support/flyway-database-cache/src/main/java/org/flywaydb/community/database/intersystems/cache/CacheTable.java @@ -1,5 +1,5 @@ /* - * Copyright (C) Red Gate Software Ltd 2010-2023 + * Copyright (C) Red Gate Software Ltd 2010-2024 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/flyway-community-db-support/flyway-database-cache/src/main/resources/META-INF/services/org.flywaydb.core.extensibility.Plugin b/flyway-community-db-support/flyway-database-cache/src/main/resources/META-INF/services/org.flywaydb.core.extensibility.Plugin new file mode 100644 index 0000000000..f4c98c3eb4 --- /dev/null +++ b/flyway-community-db-support/flyway-database-cache/src/main/resources/META-INF/services/org.flywaydb.core.extensibility.Plugin @@ -0,0 +1 @@ +org.flywaydb.community.database.intersystems.cache.CacheDatabaseType \ No newline at end of file diff --git a/flyway-community-db-support/flyway-database-iris/pom.xml b/flyway-community-db-support/flyway-database-iris/pom.xml new file mode 100644 index 0000000000..8e49e8cb61 --- /dev/null +++ b/flyway-community-db-support/flyway-database-iris/pom.xml @@ -0,0 +1,60 @@ + + + + 4.0.0 + + org.flywaydb + flyway-community-db-support + 10.5.0 + + + flyway-database-iris + ${project.artifactId} + + + + ${project.groupId} + flyway-core + + + com.intersys + iris-jdbc + true + + + + + + + src/main/resources + true + + + + + maven-resources-plugin + + + maven-jar-plugin + + + + \ No newline at end of file diff --git a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisConnection.java b/flyway-community-db-support/flyway-database-iris/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisConnection.java similarity index 96% rename from flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisConnection.java rename to flyway-community-db-support/flyway-database-iris/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisConnection.java index b188d10448..94f03bf294 100644 --- a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisConnection.java +++ b/flyway-community-db-support/flyway-database-iris/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (C) Red Gate Software Ltd 2010-2023 + * Copyright (C) Red Gate Software Ltd 2010-2024 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisDatabase.java b/flyway-community-db-support/flyway-database-iris/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisDatabase.java similarity index 96% rename from flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisDatabase.java rename to flyway-community-db-support/flyway-database-iris/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisDatabase.java index 71517e7551..f3205a77ec 100644 --- a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisDatabase.java +++ b/flyway-community-db-support/flyway-database-iris/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisDatabase.java @@ -1,5 +1,5 @@ /* - * Copyright (C) Red Gate Software Ltd 2010-2023 + * Copyright (C) Red Gate Software Ltd 2010-2024 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ protected IrisConnection doGetConnection(Connection connection) } @Override - public void ensureSupported() + public void ensureSupported(Configuration configuration) { ensureDatabaseIsRecentEnough("2019.1"); } diff --git a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisDatabaseType.java b/flyway-community-db-support/flyway-database-iris/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisDatabaseType.java similarity index 97% rename from flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisDatabaseType.java rename to flyway-community-db-support/flyway-database-iris/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisDatabaseType.java index 7327264c01..d2dac0866b 100644 --- a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisDatabaseType.java +++ b/flyway-community-db-support/flyway-database-iris/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisDatabaseType.java @@ -1,5 +1,5 @@ /* - * Copyright (C) Red Gate Software Ltd 2010-2023 + * Copyright (C) Red Gate Software Ltd 2010-2024 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisParser.java b/flyway-community-db-support/flyway-database-iris/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisParser.java similarity index 95% rename from flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisParser.java rename to flyway-community-db-support/flyway-database-iris/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisParser.java index 833183395c..aca9b87a86 100644 --- a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisParser.java +++ b/flyway-community-db-support/flyway-database-iris/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisParser.java @@ -1,5 +1,5 @@ /* - * Copyright (C) Red Gate Software Ltd 2010-2023 + * Copyright (C) Red Gate Software Ltd 2010-2024 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisSchema.java b/flyway-community-db-support/flyway-database-iris/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisSchema.java similarity index 98% rename from flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisSchema.java rename to flyway-community-db-support/flyway-database-iris/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisSchema.java index e65d841605..bcd7ae2072 100644 --- a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisSchema.java +++ b/flyway-community-db-support/flyway-database-iris/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisSchema.java @@ -1,5 +1,5 @@ /* - * Copyright (C) Red Gate Software Ltd 2010-2023 + * Copyright (C) Red Gate Software Ltd 2010-2024 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisTable.java b/flyway-community-db-support/flyway-database-iris/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisTable.java similarity index 97% rename from flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisTable.java rename to flyway-community-db-support/flyway-database-iris/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisTable.java index 05c01a30d2..0748043215 100644 --- a/flyway-community-db-support/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisTable.java +++ b/flyway-community-db-support/flyway-database-iris/src/main/java/org/flywaydb/community/database/intersystems/iris/IrisTable.java @@ -1,5 +1,5 @@ /* - * Copyright (C) Red Gate Software Ltd 2010-2023 + * Copyright (C) Red Gate Software Ltd 2010-2024 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/flyway-community-db-support/flyway-database-iris/src/main/resources/META-INF/services/org.flywaydb.core.extensibility.Plugin b/flyway-community-db-support/flyway-database-iris/src/main/resources/META-INF/services/org.flywaydb.core.extensibility.Plugin new file mode 100644 index 0000000000..e769b2ff9d --- /dev/null +++ b/flyway-community-db-support/flyway-database-iris/src/main/resources/META-INF/services/org.flywaydb.core.extensibility.Plugin @@ -0,0 +1 @@ +org.flywaydb.community.database.intersystems.iris.IrisDatabaseType \ No newline at end of file diff --git a/flyway-community-db-support/pom.xml b/flyway-community-db-support/pom.xml index d6f7491e5b..941d125a04 100644 --- a/flyway-community-db-support/pom.xml +++ b/flyway-community-db-support/pom.xml @@ -33,6 +33,8 @@ flyway-database-tidb flyway-database-ignite flyway-database-yugabytedb + flyway-database-cache + flyway-database-iris diff --git a/flyway-community-db-support/src/main/resources/META-INF/services/org.flywaydb.core.extensibility.Plugin b/flyway-community-db-support/src/main/resources/META-INF/services/org.flywaydb.core.extensibility.Plugin deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/pom.xml b/pom.xml index 6f305f74ad..b558a03d4e 100644 --- a/pom.xml +++ b/pom.xml @@ -122,6 +122,11 @@ ${releaseRepository.name} ${releaseRepository.url} + + + + +