Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1548: OTP cannot be created without userId #1549

Merged
merged 2 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion docs/Web-Flow-1.6.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.9.xsd">

<changeSet id="1" logicalFilePath="powerauth-nextstep/1.6.x/20240116-add-tag-1.6.0.xml" author="Zdenek Cerny">
<tagDatabase tag="powerauth-nextstep/1.6.0"/>
</changeSet>

</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.9.xsd">

<changeSet id="1" logicalFilePath="powerauth-nextstep/1.6.x/20240116-correct-userid-nullable.xml" author="Zdenek Cerny">
<preConditions onFail="MARK_RAN">
<tableExists tableName="ns_otp_storage"/>
<columnExists tableName="ns_otp_storage" columnName="user_id"/>
</preConditions>
<comment>Make user_id column in table ns_otp_storage nullable</comment>
<dropNotNullConstraint tableName="ns_otp_storage" columnName="user_id" columnDataType="varchar(255)" />
</changeSet>

</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.9.xsd">

<include file="20240116-correct-userid-nullable.xml" relativeToChangelogFile="true" />
<include file="20240116-add-tag-1.6.0.xml" relativeToChangelogFile="true" />

</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@

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

</databaseChangeLog>
Empty file.
3 changes: 3 additions & 0 deletions docs/sql/postgresql/migration_1.5.1_1.6.0.sql
Original file line number Diff line number Diff line change
@@ -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;
Loading