From b07ce34f9376a49a5b21e1b83c6e42472798c44e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zden=C4=9Bk=20=C4=8Cern=C3=BD?= Date: Wed, 17 Jan 2024 10:33:40 +0100 Subject: [PATCH] Fix #1548: OTP cannot be created without userId (#1549) (cherry picked from commit 2750b577a0530d66d8cd326ce804fa417d58bc00) --- docs/Web-Flow-1.6.0.md | 14 +++++++++++++- .../1.6.x/20240116-add-tag-1.6.0.xml | 10 ++++++++++ .../1.6.x/20240116-correct-userid-nullable.xml | 15 +++++++++++++++ .../1.6.x/db.changelog-version.xml | 9 +++++++++ .../powerauth-nextstep/db.changelog-module.xml | 1 + docs/sql/oracle/migration_1.5.1_1.6.0.sql | 0 docs/sql/postgresql/migration_1.5.1_1.6.0.sql | 3 +++ 7 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 docs/db/changelog/changesets/powerauth-nextstep/1.6.x/20240116-add-tag-1.6.0.xml create mode 100644 docs/db/changelog/changesets/powerauth-nextstep/1.6.x/20240116-correct-userid-nullable.xml create mode 100644 docs/db/changelog/changesets/powerauth-nextstep/1.6.x/db.changelog-version.xml create mode 100644 docs/sql/oracle/migration_1.5.1_1.6.0.sql create mode 100644 docs/sql/postgresql/migration_1.5.1_1.6.0.sql diff --git a/docs/Web-Flow-1.6.0.md b/docs/Web-Flow-1.6.0.md index b98fad10a..4098b7e82 100644 --- a/docs/Web-Flow-1.6.0.md +++ b/docs/Web-Flow-1.6.0.md @@ -2,4 +2,16 @@ This guide contains instructions for migration from PowerAuth WebFlow version `1.5.x` to version `1.6.0`. -No migration steps nor database changes are required. +## Database Changes + +For convenience you can use liquibase for your database migration. + +For manual changes use SQL scripts: + +- [PostgreSQL script](./sql/postgresql/migration_1.5.1_1.6.0.sql) +- [Oracle script](./sql/oracle/migration_1.5.1_1.6.0.sql) + +### Fix DB Bug for Creating OTP without User ID + +The column `user_id` in table `ns_otp_storage` is nullable now. + diff --git a/docs/db/changelog/changesets/powerauth-nextstep/1.6.x/20240116-add-tag-1.6.0.xml b/docs/db/changelog/changesets/powerauth-nextstep/1.6.x/20240116-add-tag-1.6.0.xml new file mode 100644 index 000000000..22ac26964 --- /dev/null +++ b/docs/db/changelog/changesets/powerauth-nextstep/1.6.x/20240116-add-tag-1.6.0.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/docs/db/changelog/changesets/powerauth-nextstep/1.6.x/20240116-correct-userid-nullable.xml b/docs/db/changelog/changesets/powerauth-nextstep/1.6.x/20240116-correct-userid-nullable.xml new file mode 100644 index 000000000..14f169785 --- /dev/null +++ b/docs/db/changelog/changesets/powerauth-nextstep/1.6.x/20240116-correct-userid-nullable.xml @@ -0,0 +1,15 @@ + + + + + + + + + Make user_id column in table ns_otp_storage nullable + + + + diff --git a/docs/db/changelog/changesets/powerauth-nextstep/1.6.x/db.changelog-version.xml b/docs/db/changelog/changesets/powerauth-nextstep/1.6.x/db.changelog-version.xml new file mode 100644 index 000000000..d858e57cc --- /dev/null +++ b/docs/db/changelog/changesets/powerauth-nextstep/1.6.x/db.changelog-version.xml @@ -0,0 +1,9 @@ + + + + + + + \ No newline at end of file diff --git a/docs/db/changelog/changesets/powerauth-nextstep/db.changelog-module.xml b/docs/db/changelog/changesets/powerauth-nextstep/db.changelog-module.xml index 9599a2fe8..809a7819d 100644 --- a/docs/db/changelog/changesets/powerauth-nextstep/db.changelog-module.xml +++ b/docs/db/changelog/changesets/powerauth-nextstep/db.changelog-module.xml @@ -12,5 +12,6 @@ + \ No newline at end of file diff --git a/docs/sql/oracle/migration_1.5.1_1.6.0.sql b/docs/sql/oracle/migration_1.5.1_1.6.0.sql new file mode 100644 index 000000000..e69de29bb diff --git a/docs/sql/postgresql/migration_1.5.1_1.6.0.sql b/docs/sql/postgresql/migration_1.5.1_1.6.0.sql new file mode 100644 index 000000000..14f1fd51f --- /dev/null +++ b/docs/sql/postgresql/migration_1.5.1_1.6.0.sql @@ -0,0 +1,3 @@ +-- Changeset powerauth-nextstep/1.6.x/20240116-correct-userid-nullable.xml::1::Zdenek Cerny +-- Make user_id column in table ns_otp_storage nullable +ALTER TABLE ns_otp_storage ALTER COLUMN user_id DROP NOT NULL; \ No newline at end of file