Skip to content

Commit

Permalink
Merge pull request #559 from /issues/558-col-rename
Browse files Browse the repository at this point in the history
Fix #558: Rename POSTCARD_PRIVATE_KEY_ENCRYPTION column
  • Loading branch information
petrdvorak authored Apr 13, 2021
2 parents 5ab7f07 + a951f3f commit 9ea3782
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
12 changes: 8 additions & 4 deletions docs/PowerAuth-Server-1.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,19 @@ Following DB changes occurred between version 0.24.0 and 1.0.0:
- Table `pa_activation` - added column `flags`.
- Table `pa_application` - added column `roles`.
- Table `pa_application_callback` - added column `attributes`.
- Table `pa_recovery_config` - added column `postcard_private_key_encryption`.
- Table `pa_recovery_config` - added column `postcard_priv_key_encryption`.

<!-- begin box warning -->
Warning: If you are upgrading to 1.0.0 version, please use `POSTCARD_PRIVATE_KEY_ENCRYPTION` in the last command. The column name was changed to `POSTCARD_PRIV_KEY_ENCRYPTION` in 1.0.1 bugfix version to account for the 30-character limit in the Oracle databases. If you are upgrading from 1.0.0 version and already used the old column name, make sure to apply the additional change.
<!-- end -->

Migration script for Oracle:

```sql
ALTER TABLE "PA_ACTIVATION" ADD "FLAGS" VARCHAR2(255 CHAR);
ALTER TABLE "PA_APPLICATION" ADD "ROLES" VARCHAR2(255 CHAR);
ALTER TABLE "PA_APPLICATION_CALLBACK" ADD "ATTRIBUTES" VARCHAR2(1024 CHAR);
ALTER TABLE "PA_RECOVERY_CONFIG" ADD "POSTCARD_PRIVATE_KEY_ENCRYPTION" NUMBER(10,0) DEFAULT 0 NOT NULL;
ALTER TABLE "PA_RECOVERY_CONFIG" ADD "POSTCARD_PRIV_KEY_ENCRYPTION" NUMBER(10,0) DEFAULT 0 NOT NULL;
```

Migration script for MySQL:
Expand All @@ -39,7 +43,7 @@ Migration script for MySQL:
ALTER TABLE `pa_activation` ADD `flags` varchar(255);
ALTER TABLE `pa_application` ADD `roles` varchar(255);
ALTER TABLE `pa_application_callback` ADD `attributes` text NOT NULL;
ALTER TABLE `pa_recovery_config` ADD `postcard_private_key_encryption` int(11) NOT NULL DEFAULT 0;
ALTER TABLE `pa_recovery_config` ADD `postcard_priv_key_encryption` int(11) NOT NULL DEFAULT 0;
```

Migration script for PostgreSQL:
Expand All @@ -48,7 +52,7 @@ Migration script for PostgreSQL:
ALTER TABLE "pa_activation" ADD "flags" VARCHAR(255);
ALTER TABLE "pa_application" ADD "roles" VARCHAR(255);
ALTER TABLE "pa_application_callback" ADD "attributes" VARCHAR(1024);
ALTER TABLE "pa_recovery_config" ADD "postcard_private_key_encryption" INTEGER DEFAULT 0 NOT NULL;
ALTER TABLE "pa_recovery_config" ADD "postcard_priv_key_encryption" INTEGER DEFAULT 0 NOT NULL;
```

## New REST Client and SOAP Client Updates
Expand Down
2 changes: 1 addition & 1 deletion docs/sql/mysql/create_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ CREATE TABLE `pa_recovery_config` (
`postcard_private_key_base64` varchar(255),
`postcard_public_key_base64` varchar(255),
`remote_public_key_base64` varchar(255),
`postcard_private_key_encryption` int(11) NOT NULL DEFAULT 0,
`postcard_priv_key_encryption` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
CONSTRAINT `FK_RECOVERY_CONFIG_APP` FOREIGN KEY (`application_id`) REFERENCES `pa_application` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=1 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Expand Down
2 changes: 1 addition & 1 deletion docs/sql/oracle/create_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ CREATE TABLE "PA_RECOVERY_CONFIG" (
"POSTCARD_PRIVATE_KEY_BASE64" VARCHAR2(255 CHAR),
"POSTCARD_PUBLIC_KEY_BASE64" VARCHAR2(255 CHAR),
"REMOTE_PUBLIC_KEY_BASE64" VARCHAR2(255 CHAR),
"POSTCARD_PRIVATE_KEY_ENCRYPTION" NUMBER(10,0) DEFAULT 0 NOT NULL
"POSTCARD_PRIV_KEY_ENCRYPTION" NUMBER(10,0) DEFAULT 0 NOT NULL
);

--
Expand Down
2 changes: 1 addition & 1 deletion docs/sql/postgresql/create_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ CREATE TABLE "pa_recovery_config" (
"postcard_private_key_base64" VARCHAR(255),
"postcard_public_key_base64" VARCHAR(255),
"remote_public_key_base64" VARCHAR(255),
"postcard_private_key_encryption" INTEGER DEFAULT 0 NOT NULL
"postcard_priv_key_encryption" INTEGER DEFAULT 0 NOT NULL
);

--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class RecoveryConfigEntity implements Serializable {
@Column(name = "remote_public_key_base64")
private String remotePostcardPublicKeyBase64;

@Column(name = "postcard_private_key_encryption", nullable = false)
@Column(name = "postcard_priv_key_encryption", nullable = false)
@Enumerated
private EncryptionMode privateKeyEncryption;

Expand Down

0 comments on commit 9ea3782

Please sign in to comment.