Skip to content

Commit

Permalink
Merge pull request #1728 from /issues/1727-oracle-liquibase
Browse files Browse the repository at this point in the history
Fix #1727: Liquibase on Oracle throws "index already exists" error
  • Loading branch information
banterCZ authored Oct 31, 2024
2 parents 3efa584 + 69b43e6 commit b016412
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 16 deletions.
6 changes: 3 additions & 3 deletions doc-private/Developer-How-To-Start.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Important and fixed parameter is `changelog-file`.
Others (like URL, username, password) depend on your environment.

```shell
liquibase --changelog-file=./docs/db/changelog/changesets/powerauth-webflow/db.changelog-module.xml --url=jdbc:postgresql://localhost:5432/powerauth --username=powerauth --hub-mode=off status
liquibase --changelog-file=./docs/db/changelog/changesets/powerauth-webflow/db.changelog-module.xml --url=jdbc:postgresql://localhost:5432/powerauth --username=powerauth status
```


Expand All @@ -41,7 +41,7 @@ Important and fixed parameter is `changelog-file`.
Others (like URL, username, password) depend on your environment.

```shell
liquibase --changelog-file=./docs/db/changelog/changesets/powerauth-tpp-engine/db.changelog-module.xml --url=jdbc:postgresql://localhost:5432/powerauth --username=powerauth --hub-mode=off status
liquibase --changelog-file=./docs/db/changelog/changesets/powerauth-tpp-engine/db.changelog-module.xml --url=jdbc:postgresql://localhost:5432/powerauth --username=powerauth status
```


Expand All @@ -63,7 +63,7 @@ Important and fixed parameter is `changelog-file`.
Others (like URL, username, password) depend on your environment.

```shell
liquibase --changelog-file=./docs/db/changelog/changesets/powerauth-nextstep/db.changelog-module.xml --url=jdbc:postgresql://localhost:5432/powerauth --username=powerauth --hub-mode=off status
liquibase --changelog-file=./docs/db/changelog/changesets/powerauth-nextstep/db.changelog-module.xml --url=jdbc:postgresql://localhost:5432/powerauth --username=powerauth status
```

When all user identities are stored in Next Step, add foreign keys for user identity manually (they are not part of liquibase changesets).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,7 @@
</createIndex>
</changeSet>

<changeSet id="6" logicalFilePath="powerauth-webflow/1.4.x/20230324-init-db.xml" author="Lubos Racansky">
<preConditions onFail="MARK_RAN">
<not>
<indexExists tableName="wf_certificate_verification" indexName="wf_certificate_operation"/>
</not>
</preConditions>
<comment>Create a new index wf_certificate_verification(operation_id)</comment>
<createIndex tableName="wf_operation_session" indexName="wf_certificate_operation">
<column name="operation_id" />
</createIndex>
</changeSet>
<!-- changeSet id="6" omitted on purpose, because it has been creating an index on primary key -->

<!-- See: https://github.com/spring-projects/spring-security-oauth/blob/master/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/client/JdbcClientDetailsService.java -->
<changeSet id="7" logicalFilePath="powerauth-webflow/1.4.x/20230324-init-db.xml" author="Lubos Racansky">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
<property name="now" value="current_timestamp" dbms="postgresql"/>
<property name="now" value="sysdate" dbms="oracle"/>

<property name="blob_type" value="bytea" dbms="postgresql"/>
<property name="blob_type" value="blob" dbms="oracle"/>

<include file="1.4.x/db.changelog-version.xml" relativeToChangelogFile="true" />
<include file="1.5.x/db.changelog-version.xml" relativeToChangelogFile="true" />

Expand Down
1 change: 0 additions & 1 deletion docs/sql/oracle/create_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,6 @@ CREATE INDEX wf_operation_hash ON wf_operation_session (operation_hash);
CREATE INDEX wf_websocket_session ON wf_operation_session (websocket_session_id);
CREATE INDEX ns_operation_pending ON ns_operation (user_id, result);
CREATE UNIQUE INDEX ns_operation_afs_unique on ns_operation_afs (operation_id, request_afs_action, request_step_index);
CREATE INDEX wf_certificate_operation ON wf_certificate_verification (operation_id);
CREATE UNIQUE INDEX ns_application_name ON ns_application (name);
CREATE UNIQUE INDEX ns_credential_policy_name ON ns_credential_policy (name);
CREATE UNIQUE INDEX ns_otp_policy_name ON ns_otp_policy (name);
Expand Down
1 change: 0 additions & 1 deletion docs/sql/postgresql/create_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,6 @@ CREATE INDEX wf_operation_hash ON wf_operation_session (operation_hash);
CREATE INDEX wf_websocket_session ON wf_operation_session (websocket_session_id);
CREATE INDEX ns_operation_pending ON ns_operation (user_id, result);
CREATE UNIQUE INDEX ns_operation_afs_unique ON ns_operation_afs (operation_id, request_afs_action, request_step_index);
CREATE INDEX wf_certificate_operation ON wf_certificate_verification (operation_id);
CREATE UNIQUE INDEX ns_application_name ON ns_application (name);
CREATE UNIQUE INDEX ns_credential_policy_name ON ns_credential_policy (name);
CREATE UNIQUE INDEX ns_otp_policy_name ON ns_otp_policy (name);
Expand Down

0 comments on commit b016412

Please sign in to comment.