sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jso...@apache.org
Subject [sis] branch geoapi-4.0 updated: Dialect : improve support for sqlite, ignore statements with table constraint modifications
Date Mon, 01 Jun 2020 13:01:08 GMT
This is an automated email from the ASF dual-hosted git repository.

jsorel pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git


The following commit(s) were added to refs/heads/geoapi-4.0 by this push:
     new d532cb5  Dialect : improve support for sqlite, ignore statements with table constraint
modifications
d532cb5 is described below

commit d532cb5e57ba93b3434553ecbe77b5ad1694c4af
Author: jsorel <johann.sorel@geomatys.com>
AuthorDate: Mon Jun 1 15:00:46 2020 +0200

    Dialect : improve support for sqlite, ignore statements with table constraint modifications
---
 .../src/main/java/org/apache/sis/internal/metadata/sql/Dialect.java | 6 +++---
 .../java/org/apache/sis/internal/metadata/sql/ScriptRunner.java     | 3 +++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Dialect.java
b/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Dialect.java
index a903e21..1865d76 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Dialect.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Dialect.java
@@ -91,16 +91,16 @@ public enum Dialect {
      *
      * @see <a href="https://www.sqlite.org/omitted.html">SQL Features That SQLite
Does Not Implement</a>
      */
-    public final boolean supportsAlterTableWithAddForeignKey;
+    public final boolean supportsAlterTableWithAddConstraint;
 
     /**
      * Creates a new enumeration value for a SQL dialect for the given protocol.
      */
     private Dialect(final String protocol, final boolean isTableInheritanceSupported,
-            final boolean supportsAlterTableWithAddForeignKey) {
+            final boolean supportsAlterTableWithAddConstraint) {
         this.protocol = protocol;
         this.isTableInheritanceSupported = isTableInheritanceSupported;
-        this.supportsAlterTableWithAddForeignKey = supportsAlterTableWithAddForeignKey;
+        this.supportsAlterTableWithAddConstraint = supportsAlterTableWithAddConstraint;
     }
 
     /**
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/ScriptRunner.java
b/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/ScriptRunner.java
index 0f2884d..c6af122 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/ScriptRunner.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/ScriptRunner.java
@@ -342,6 +342,9 @@ public class ScriptRunner implements AutoCloseable {
         if (!isCommentSupported) {
             addStatementToSkip("COMMENT\\s+ON\\s+.*");
         }
+        if (!dialect.supportsAlterTableWithAddConstraint) {
+            addStatementToSkip("ALTER TABLE.+ADD CONSTRAINT.*");
+        }
     }
 
     /**


Mime
View raw message