diff --git a/docs/PowerAuth-Push-Server-1.7.0.md b/docs/PowerAuth-Push-Server-1.7.0.md index 34b70620e..4f3a2c0e3 100644 --- a/docs/PowerAuth-Push-Server-1.7.0.md +++ b/docs/PowerAuth-Push-Server-1.7.0.md @@ -5,6 +5,14 @@ This guide contains instructions for migration from PowerAuth Push Server versio ## Database Changes +For convenience, you can use liquibase for your database migration. + +If you prefer to make manual DB schema changes, please use the following SQL scripts: + +- [PostgreSQL script](./sql/postgresql/migration_1.6.0_1.7.0.sql) +- [Oracle script](./sql/oracle/migration_1.6.0_1.7.0.sql) +- [MSSQL script](./sql/mssql/migration_1.6.0_1.7.0.sql) + ### Huawei Mobile Services diff --git a/docs/sql/mssql/migration_1.6.0_1.7.0.sql b/docs/sql/mssql/migration_1.6.0_1.7.0.sql new file mode 100644 index 000000000..daf12533e --- /dev/null +++ b/docs/sql/mssql/migration_1.6.0_1.7.0.sql @@ -0,0 +1,19 @@ +-- Changeset powerauth-push-server/1.7.x/20240119-push_app_credentials-hms.xml::1::Lubos Racansky +-- Add hms_project_id, hms_client_id, and hms_client_secret columns to push_app_credentials +ALTER TABLE push_app_credentials ADD hms_project_id varchar(255); +GO + +ALTER TABLE push_app_credentials ADD hms_client_id varchar(255); +GO + +ALTER TABLE push_app_credentials ADD hms_client_secret varchar(255); +GO + +IF EXISTS( SELECT extended_properties.value FROM sys.extended_properties WHERE major_id = OBJECT_ID('dbo.push_app_credentials') AND name = N'MS_DESCRIPTION' AND minor_id = ( SELECT column_id FROM sys.columns WHERE name = 'hms_project_id' AND object_id = OBJECT_ID('dbo.push_app_credentials')) ) BEGIN EXEC sys.sp_updateextendedproperty @name = N'MS_Description' , @value = N'Project ID defined in Huawei AppGallery Connect.' , @level0type = N'SCHEMA' , @level0name = N'dbo' , @level1type = N'TABLE' , @level1name = N'push_app_credentials' , @level2type = N'COLUMN' , @level2name = N'hms_project_id' END ELSE BEGIN EXEC sys.sp_addextendedproperty @name = N'MS_Description' , @value = N'Project ID defined in Huawei AppGallery Connect.' , @level0type = N'SCHEMA' , @level0name = N'dbo' , @level1type = N'TABLE' , @level1name = N'push_app_credentials' , @level2type = N'COLUMN' , @level2name = N'hms_project_id' END; +GO + +IF EXISTS( SELECT extended_properties.value FROM sys.extended_properties WHERE major_id = OBJECT_ID('dbo.push_app_credentials') AND name = N'MS_DESCRIPTION' AND minor_id = ( SELECT column_id FROM sys.columns WHERE name = 'hms_client_id' AND object_id = OBJECT_ID('dbo.push_app_credentials')) ) BEGIN EXEC sys.sp_updateextendedproperty @name = N'MS_Description' , @value = N'Huawei OAuth 2.0 Client ID.' , @level0type = N'SCHEMA' , @level0name = N'dbo' , @level1type = N'TABLE' , @level1name = N'push_app_credentials' , @level2type = N'COLUMN' , @level2name = N'hms_client_id' END ELSE BEGIN EXEC sys.sp_addextendedproperty @name = N'MS_Description' , @value = N'Huawei OAuth 2.0 Client ID.' , @level0type = N'SCHEMA' , @level0name = N'dbo' , @level1type = N'TABLE' , @level1name = N'push_app_credentials' , @level2type = N'COLUMN' , @level2name = N'hms_client_id' END; +GO + +IF EXISTS( SELECT extended_properties.value FROM sys.extended_properties WHERE major_id = OBJECT_ID('dbo.push_app_credentials') AND name = N'MS_DESCRIPTION' AND minor_id = ( SELECT column_id FROM sys.columns WHERE name = 'hms_client_secret' AND object_id = OBJECT_ID('dbo.push_app_credentials')) ) BEGIN EXEC sys.sp_updateextendedproperty @name = N'MS_Description' , @value = N'Huawei OAuth 2.0 Client Secret.' , @level0type = N'SCHEMA' , @level0name = N'dbo' , @level1type = N'TABLE' , @level1name = N'push_app_credentials' , @level2type = N'COLUMN' , @level2name = N'hms_client_secret' END ELSE BEGIN EXEC sys.sp_addextendedproperty @name = N'MS_Description' , @value = N'Huawei OAuth 2.0 Client Secret.' , @level0type = N'SCHEMA' , @level0name = N'dbo' , @level1type = N'TABLE' , @level1name = N'push_app_credentials' , @level2type = N'COLUMN' , @level2name = N'hms_client_secret' END; +GO diff --git a/docs/sql/oracle/migration_1.6.0_1.7.0.sql b/docs/sql/oracle/migration_1.6.0_1.7.0.sql new file mode 100644 index 000000000..2067e7a45 --- /dev/null +++ b/docs/sql/oracle/migration_1.6.0_1.7.0.sql @@ -0,0 +1,13 @@ +-- Changeset powerauth-push-server/1.7.x/20240119-push_app_credentials-hms.xml::1::Lubos Racansky +-- Add hms_project_id, hms_client_id, and hms_client_secret columns to push_app_credentials +ALTER TABLE push_app_credentials ADD hms_project_id VARCHAR2(255); + +ALTER TABLE push_app_credentials ADD hms_client_id VARCHAR2(255); + +ALTER TABLE push_app_credentials ADD hms_client_secret VARCHAR2(255); + +COMMENT ON COLUMN push_app_credentials.hms_project_id IS 'Project ID defined in Huawei AppGallery Connect.'; + +COMMENT ON COLUMN push_app_credentials.hms_client_id IS 'Huawei OAuth 2.0 Client ID.'; + +COMMENT ON COLUMN push_app_credentials.hms_client_secret IS 'Huawei OAuth 2.0 Client Secret.'; diff --git a/docs/sql/postgresql/migration_1.6.0_1.7.0.sql b/docs/sql/postgresql/migration_1.6.0_1.7.0.sql new file mode 100644 index 000000000..6bcfc0d11 --- /dev/null +++ b/docs/sql/postgresql/migration_1.6.0_1.7.0.sql @@ -0,0 +1,13 @@ +-- Changeset powerauth-push-server/1.7.x/20240119-push_app_credentials-hms.xml::1::Lubos Racansky +-- Add hms_project_id, hms_client_id, and hms_client_secret columns to push_app_credentials +ALTER TABLE push_app_credentials ADD hms_project_id VARCHAR(255); + +ALTER TABLE push_app_credentials ADD hms_client_id VARCHAR(255); + +ALTER TABLE push_app_credentials ADD hms_client_secret VARCHAR(255); + +COMMENT ON COLUMN push_app_credentials.hms_project_id IS 'Project ID defined in Huawei AppGallery Connect.'; + +COMMENT ON COLUMN push_app_credentials.hms_client_id IS 'Huawei OAuth 2.0 Client ID.'; + +COMMENT ON COLUMN push_app_credentials.hms_client_secret IS 'Huawei OAuth 2.0 Client Secret.';