Handled unique constraints.
Change-Id: I0ee968b18b028ded76af04a0473c7997a13f2f11
diff --git a/full/src/main/resources/db/new-mysql/V1.1__create_virtual_corpus_tables.sql b/full/src/main/resources/db/new-mysql/V1.1__create_virtual_corpus_tables.sql
index 55f2163..eb9d1df 100644
--- a/full/src/main/resources/db/new-mysql/V1.1__create_virtual_corpus_tables.sql
+++ b/full/src/main/resources/db/new-mysql/V1.1__create_virtual_corpus_tables.sql
@@ -64,6 +64,7 @@
corpus_query TEXT NOT NULL,
definition varchar(255) DEFAULT NULL,
is_cached BOOLEAN DEFAULT 0,
+ UNIQUE INDEX unique_index (name,created_by),
INDEX owner_index (created_by),
INDEX type_index (type)
);
diff --git a/full/src/main/resources/db/new-sqlite/V1.1__create_virtual_corpus_tables.sql b/full/src/main/resources/db/new-sqlite/V1.1__create_virtual_corpus_tables.sql
index 56fc105..0547591 100644
--- a/full/src/main/resources/db/new-sqlite/V1.1__create_virtual_corpus_tables.sql
+++ b/full/src/main/resources/db/new-sqlite/V1.1__create_virtual_corpus_tables.sql
@@ -78,6 +78,8 @@
CREATE INDEX virtual_corpus_owner_index ON virtual_corpus(created_by);
CREATE INDEX virtual_corpus_type_index ON virtual_corpus(type);
+CREATE UNIQUE INDEX virtual_corpus_unique_name
+ ON virtual_corpus(name,created_by);
CREATE TABLE IF NOT EXISTS virtual_corpus_access (
id INTEGER PRIMARY KEY AUTOINCREMENT,
@@ -97,6 +99,6 @@
CREATE INDEX virtual_corpus_status_index
ON virtual_corpus_access(status);
-CREATE INDEX virtual_corpus_access_unique_index
+CREATE UNIQUE INDEX virtual_corpus_access_unique_index
ON virtual_corpus_access(virtual_corpus_id,user_group_id);
diff --git a/full/src/main/resources/db/new-sqlite/V1.4__oauth2_tables.sql b/full/src/main/resources/db/new-sqlite/V1.4__oauth2_tables.sql
index db238ab..e0c06d6 100644
--- a/full/src/main/resources/db/new-sqlite/V1.4__oauth2_tables.sql
+++ b/full/src/main/resources/db/new-sqlite/V1.4__oauth2_tables.sql
@@ -20,8 +20,6 @@
REFERENCES oauth2_client_url(url_hashcode)
);
-CREATE UNIQUE INDEX client_id_index on oauth2_client(id);
-
CREATE TABLE IF NOT EXISTS oauth2_access_scope (
id VARCHAR(255) PRIMARY KEY NOT NULL
);
diff --git a/full/src/main/resources/kustvakt.conf b/full/src/main/resources/kustvakt.conf
index 3932b82..c5a4958 100644
--- a/full/src/main/resources/kustvakt.conf
+++ b/full/src/main/resources/kustvakt.conf
@@ -12,7 +12,7 @@
ldap.config = file-path-to-ldap-config
# Kustvakt
-current.api.version = v1.0
+current.api.version = v1.1
# multiple versions separated by space
supported.api.version = v1.0