Skip to content

Commit

Permalink
fix: add missing IF NOT EXIST statements in SQL stores (#302)
Browse files Browse the repository at this point in the history
fix: add missing IF NOT EXIST statements in SQL stores
  • Loading branch information
bscholtes1A authored Mar 22, 2024
1 parent 989e445 commit f063a0f
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 6 deletions.
2 changes: 2 additions & 0 deletions DEPENDENCIES
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,15 @@ maven/mavencentral/org.codehaus.plexus/plexus-utils/3.3.0, , approved, CQ21066
maven/mavencentral/org.eclipse.angus/angus-activation/1.0.0, EPL-2.0 OR GPL-2.0-only with Classpath-exception-2.0, approved, ee4j.angus
maven/mavencentral/org.eclipse.edc/api-observability/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/autodoc-processor/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/boot-lib/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/boot/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/catalog-spi/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/connector-core/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/contract-spi/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/control-plane-spi/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/core-spi/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/crypto-common/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/http-lib/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/http-spi/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/http/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/identity-did-core/0.5.2-SNAPSHOT, Apache-2.0, approved, technology.edc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import static io.restassured.RestAssured.given;
import static org.eclipse.edc.boot.BootServicesExtension.PARTICIPANT_ID;
import static org.eclipse.edc.junit.testfixtures.TestUtils.getFreePort;
import static org.eclipse.edc.util.io.Ports.getFreePort;

/**
* The IdentityHubRuntimeConfiguration class represents an IdentityHub Runtime configuration and provides various information, such as API endpoints
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dependencies {
testImplementation(testFixtures(project(":spi:identity-hub-spi")))
testImplementation(libs.nimbus.jwt)
testImplementation(libs.restAssured)
testImplementation(libs.tink)
}

edcBuild {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/

-- only intended for and tested with Postgres!
CREATE TABLE credential_resource
CREATE TABLE IF NOT EXISTS credential_resource
(
id VARCHAR PRIMARY KEY NOT NULL, -- ID of the VC, duplicated here for indexing purposes
create_timestamp BIGINT NOT NULL, -- POSIX timestamp of the creation of the VC
Expand All @@ -27,7 +27,7 @@ CREATE TABLE credential_resource
verifiable_credential JSON NOT NULL, -- JSON-representation of the verifiable credential
participant_id VARCHAR -- ID of the ParticipantContext that owns this credentisl
);
CREATE UNIQUE INDEX credential_resource_credential_id_uindex ON credential_resource USING btree (id);
CREATE UNIQUE INDEX IF NOT EXISTS credential_resource_credential_id_uindex ON credential_resource USING btree (id);
COMMENT ON COLUMN credential_resource.id IS 'ID of the VC, duplicated here for indexing purposes';
COMMENT ON COLUMN credential_resource.raw_vc IS 'Representation of the VC exactly as it was received by the issuer. Can be JWT or JSON(-LD) ';
COMMENT ON COLUMN credential_resource.vc_format IS '0 = JSON-LD, 1 = JWT';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/

-- only intended for and tested with Postgres!
CREATE TABLE keypair_resource
CREATE TABLE IF NOT EXISTS keypair_resource
(
id VARCHAR PRIMARY KEY NOT NULL, -- primary key
participant_id VARCHAR, -- ID of the owning ParticipantContext. this is a loose business key, not a FK!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/

-- only intended for and tested with Postgres!
CREATE TABLE participant_context
CREATE TABLE IF NOT EXISTS participant_context
(
participant_id VARCHAR PRIMARY KEY NOT NULL, -- ID of the ParticipantContext
created_date BIGINT NOT NULL, -- POSIX timestamp of the creation of the PC
Expand All @@ -23,5 +23,5 @@ CREATE TABLE participant_context
did VARCHAR, -- the DID with which this participant is identified
roles JSON -- JSON array containing all the roles a user has. may be empty
);
CREATE UNIQUE INDEX participant_context_participant_id_uindex ON participant_context USING btree (participant_id);
CREATE UNIQUE INDEX IF NOT EXISTS participant_context_participant_id_uindex ON participant_context USING btree (participant_id);

2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ restAssured = "5.4.0"
swagger = "2.2.18"
rsApi = "3.1.0"
testcontainers = "1.19.3"
tink = "1.12.0"

[libraries]
edc-util = { module = "org.eclipse.edc:util", version.ref = "edc" }
Expand Down Expand Up @@ -82,6 +83,7 @@ testcontainers-junit = { module = "org.testcontainers:junit-jupiter", version.re
testcontainers-postgres = { module = "org.testcontainers:postgres", version.ref = "testcontainers" }
jakarta-annotation = { module = "jakarta.annotation:jakarta.annotation-api", version.ref = "jakarta-annotation" }
jersey-common = { module = "org.glassfish.jersey.core:jersey-common", version.ref = "jersey" }
tink = { module = "com.google.crypto.tink:tink", version.ref = "tink" }

[bundles]
connector = ["edc-boot", "edc-core-connector", "edc-ext-http", "edc-ext-observability", "edc-ext-jsonld"]
Expand Down

0 comments on commit f063a0f

Please sign in to comment.