* Added fix for https://github.com/hapifhir/hapi-fhir-jpaserver-starter/issues/328

* Update HapiFhirJpaMigrationTasks.java

Corrected ordering

* Update HapiFhirJpaMigrationTasks.java

Moving index status to be last operation

* Revert "Update HapiFhirJpaMigrationTasks.java"

This reverts commit 37bfd3e66e.

* Moved to bottom

Co-authored-by: Jens Kristian Villadsen <jvi@trifork.com>
This commit is contained in:
Jens Kristian Villadsen 2022-05-03 11:44:47 +02:00 committed by GitHub
parent d6702f956b
commit eb4732a59e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions

View File

@ -378,6 +378,14 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks<VersionEnum> {
version.executeRawSql("20220429.9", addTagDefConstraint);
}
// Fix for https://github.com/hapifhir/hapi-fhir-jpaserver-starter/issues/328
version.onTable("NPM_PACKAGE_VER")
.modifyColumn("20220501.1","FHIR_VERSION_ID").nonNullable().withType(ColumnTypeEnum.STRING, 20);
version.onTable("NPM_PACKAGE_VER_RES")
.modifyColumn("20220501.2","FHIR_VERSION_ID").nonNullable().withType(ColumnTypeEnum.STRING, 20);
}
/**

View File

@ -56,6 +56,7 @@ public class NpmPackageVersionEntity {
public static final int VERSION_ID_LENGTH = 200;
public static final int PACKAGE_DESC_LENGTH = 200;
public static final int FHIR_VERSION_LENGTH = 10;
public static final int FHIR_VERSION_ID_LENGTH = 20;
@SequenceGenerator(name = "SEQ_NPM_PACKVER", sequenceName = "SEQ_NPM_PACKVER")
@GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_NPM_PACKVER")
@ -81,7 +82,7 @@ public class NpmPackageVersionEntity {
private String myDescriptionUpper;
@Column(name = "CURRENT_VERSION", nullable = false)
private boolean myCurrentVersion;
@Column(name = "FHIR_VERSION_ID", length = NpmPackageVersionEntity.FHIR_VERSION_LENGTH, nullable = false)
@Column(name = "FHIR_VERSION_ID", length = NpmPackageVersionEntity.FHIR_VERSION_ID_LENGTH, nullable = false)
private String myFhirVersionId;
@Enumerated(EnumType.STRING)
@Column(name = "FHIR_VERSION", length = NpmPackageVersionEntity.FHIR_VERSION_LENGTH, nullable = false)

View File

@ -74,7 +74,7 @@ public class NpmPackageVersionResourceEntity {
@Enumerated(EnumType.STRING)
@Column(name = "FHIR_VERSION", length = NpmPackageVersionEntity.FHIR_VERSION_LENGTH, nullable = false)
private FhirVersionEnum myFhirVersion;
@Column(name = "FHIR_VERSION_ID", length = NpmPackageVersionEntity.FHIR_VERSION_LENGTH, nullable = false)
@Column(name = "FHIR_VERSION_ID", length = NpmPackageVersionEntity.FHIR_VERSION_ID_LENGTH, nullable = false)
private String myFhirVersionId;
@Column(name = "RES_SIZE_BYTES", nullable = false)
private long myResSizeBytes;