diff --git a/openespi-authserver/src/main/resources/application-prod.yml b/openespi-authserver/src/main/resources/application-prod.yml index e54e3af7..44c474f7 100644 --- a/openespi-authserver/src/main/resources/application-prod.yml +++ b/openespi-authserver/src/main/resources/application-prod.yml @@ -93,6 +93,10 @@ spring: schemas: oauth2_authserver validate-on-migrate: true clean-disabled: true + # Skip V3+ pending ESPI 4.0 XSD-aligned schema repair (see issue #123). + # V1+V2 provide enough for OAuth2 grant + introspection; V3 onwards is + # seed/demo data that references columns missing from MySQL V1. + target: "2.0.0" # Logging Configuration - Production Levels logging: diff --git a/openespi-authserver/src/main/resources/db/vendor/h2/V1_0_0__create_oauth2_schema.sql b/openespi-authserver/src/main/resources/db/vendor/h2/V1_0_0__create_oauth2_schema.sql index bf0a1cc1..93dcdabc 100644 --- a/openespi-authserver/src/main/resources/db/vendor/h2/V1_0_0__create_oauth2_schema.sql +++ b/openespi-authserver/src/main/resources/db/vendor/h2/V1_0_0__create_oauth2_schema.sql @@ -64,7 +64,8 @@ CREATE TABLE oauth2_registered_client ( scopes varchar(1000) NOT NULL, client_settings varchar(2000) NOT NULL, token_settings varchar(2000) NOT NULL, - PRIMARY KEY (id) + PRIMARY KEY (id), + CONSTRAINT uk_oauth2_registered_client_client_id UNIQUE (client_id) ); -- ESPI Application Information mapping @@ -105,7 +106,6 @@ CREATE TABLE espi_application_info ( -- Create indexes for performance CREATE INDEX idx_oauth2_authorization_client_principal ON oauth2_authorization (registered_client_id, principal_name); -CREATE INDEX idx_oauth2_registered_client_id ON oauth2_registered_client (client_id); CREATE INDEX idx_espi_application_client_id ON espi_application_info (client_id); -- Insert sample data for local development