From 84d01735e2c2ae52c4a9ad361bb35f29e6a1bea4 Mon Sep 17 00:00:00 2001 From: Lubos Racansky Date: Thu, 14 Sep 2023 11:39:29 +0200 Subject: [PATCH] Fix #672: Liquibase updates --- docs/PowerAuth-Push-Server-1.4.0.md | 2 +- docs/PowerAuth-Push-Server-1.5.0.md | 17 +++++++++++++++++ docs/Push-Server-Database.md | 2 +- .../1.4.x/20230321-init-db.xml | 2 +- docs/sql/oracle/create_push_server_schema.sql | 2 +- .../postgresql/create_push_server_schema.sql | 2 +- 6 files changed, 22 insertions(+), 5 deletions(-) diff --git a/docs/PowerAuth-Push-Server-1.4.0.md b/docs/PowerAuth-Push-Server-1.4.0.md index a66ca0d1c..88583a2ad 100644 --- a/docs/PowerAuth-Push-Server-1.4.0.md +++ b/docs/PowerAuth-Push-Server-1.4.0.md @@ -16,7 +16,7 @@ Message inbox requires a simple database structure below: -- Create table for message inbox CREATE TABLE push_inbox ( id INTEGER NOT NULL CONSTRAINT push_inbox_pk PRIMARY KEY, - inbox_id VARCHAR(37), + inbox_id VARCHAR(37) NOT NULL, user_id VARCHAR(255) NOT NULL, type VARCHAR(32) NOT NULL, subject TEXT NOT NULL, diff --git a/docs/PowerAuth-Push-Server-1.5.0.md b/docs/PowerAuth-Push-Server-1.5.0.md index 65b85238c..7b4788eb1 100644 --- a/docs/PowerAuth-Push-Server-1.5.0.md +++ b/docs/PowerAuth-Push-Server-1.5.0.md @@ -115,6 +115,23 @@ CREATE UNIQUE INDEX push_app_cred_app ON push_app_credentials(app_id); ``` +### Missing Inbox Constraint + +Inbox table is missing _not null_ constraint for `inbox_id`. + +### PostgreSQL + +```sql +alter table push_inbox alter column inbox_id set not null; +``` + +### Oracle + +```sql +alter table push_inbox modify inbox_id not null; +``` + + ### Drop MySQL Support Since version `1.5.0`, MySQL database is not supported anymore. diff --git a/docs/Push-Server-Database.md b/docs/Push-Server-Database.md index 5e09541b9..d688a6d8f 100644 --- a/docs/Push-Server-Database.md +++ b/docs/Push-Server-Database.md @@ -273,7 +273,7 @@ Stores the messages to be delivered to particular users. ```sql CREATE TABLE push_inbox ( id INTEGER NOT NULL CONSTRAINT push_inbox_pk PRIMARY KEY, - inbox_id VARCHAR(37), + inbox_id VARCHAR(37) NOT NULL, user_id VARCHAR(255) NOT NULL, type VARCHAR(32) NOT NULL; subject TEXT NOT NULL, diff --git a/docs/db/changelog/changesets/powerauth-push-server/1.4.x/20230321-init-db.xml b/docs/db/changelog/changesets/powerauth-push-server/1.4.x/20230321-init-db.xml index 2155d42a5..41d268cda 100644 --- a/docs/db/changelog/changesets/powerauth-push-server/1.4.x/20230321-init-db.xml +++ b/docs/db/changelog/changesets/powerauth-push-server/1.4.x/20230321-init-db.xml @@ -209,7 +209,7 @@ - Create a new sequence push_inbox + Create a new table push_inbox diff --git a/docs/sql/oracle/create_push_server_schema.sql b/docs/sql/oracle/create_push_server_schema.sql index 5ee7cde5c..0531c62ba 100644 --- a/docs/sql/oracle/create_push_server_schema.sql +++ b/docs/sql/oracle/create_push_server_schema.sql @@ -62,7 +62,7 @@ CREATE TABLE PUSH_CAMPAIGN_USER ( CREATE TABLE PUSH_INBOX ( ID NUMBER(19) PRIMARY KEY NOT NULL, - INBOX_ID VARCHAR2(37 CHAR), + INBOX_ID VARCHAR2(37 CHAR) NOT NULL, USER_ID VARCHAR2(255 CHAR) NOT NULL, TYPE VARCHAR2(32 CHAR) NOT NULL, SUBJECT VARCHAR2(4000 CHAR) NOT NULL, diff --git a/docs/sql/postgresql/create_push_server_schema.sql b/docs/sql/postgresql/create_push_server_schema.sql index 16b37bdf3..4cfef0259 100644 --- a/docs/sql/postgresql/create_push_server_schema.sql +++ b/docs/sql/postgresql/create_push_server_schema.sql @@ -77,7 +77,7 @@ CREATE TABLE push_campaign_user ( -- Create table for message inbox CREATE TABLE push_inbox ( id INTEGER NOT NULL CONSTRAINT push_inbox_pk PRIMARY KEY, - inbox_id VARCHAR(37), + inbox_id VARCHAR(37) NOT NULL, user_id VARCHAR(255) NOT NULL, type VARCHAR(32) NOT NULL, subject TEXT NOT NULL,