Class CreateWholeSchemaVersion
- java.lang.Object
-
- org.linuxforhealth.fhir.database.utils.version.CreateWholeSchemaVersion
-
public class CreateWholeSchemaVersion extends java.lang.Object
Creates the WHOLE_SCHEMA_VERSION table. Although this is an administration table, for least privileges it is stored in the data schema, not the admin schema. This makes it easier to keep data private so that tenants aren't able to see the schema version used by other tenants, but do get to see their own tenant version. This is because the table will contain only one row.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ADMIN_GROUP
static java.lang.String
SCHEMA_GROUP_TAG
-
Constructor Summary
Constructors Constructor Description CreateWholeSchemaVersion()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Table
buildTableDef(PhysicalDataModel dataModel, java.lang.String schemaName, boolean addTags)
Builds the definition of the WHOLE_SCHEMA_VERSION table in the schema identified by schemaNamestatic void
createTableIfNeeded(java.lang.String schemaName, ISchemaAdapter target)
Create the WHOLE_SCHEMA_VERSION table.static void
dropTable(java.lang.String schemaName, ISchemaAdapter target)
Drop the WHOLE_SCHEMA_VERSION table if it exists in the given schemastatic void
grantPrivilegesTo(ISchemaAdapter target, java.lang.String schemaName, java.lang.String groupName, java.lang.String toUser)
Grant the user privileges so that the row from this table can be read by the $healthcheck custom operation.
-
-
-
Field Detail
-
SCHEMA_GROUP_TAG
public static final java.lang.String SCHEMA_GROUP_TAG
- See Also:
- Constant Field Values
-
ADMIN_GROUP
public static final java.lang.String ADMIN_GROUP
- See Also:
- Constant Field Values
-
-
Method Detail
-
buildTableDef
public static Table buildTableDef(PhysicalDataModel dataModel, java.lang.String schemaName, boolean addTags)
Builds the definition of the WHOLE_SCHEMA_VERSION table in the schema identified by schemaName- Parameters:
dataModel
-schemaName
-addTags
-- Returns:
- the
Table
definition
-
createTableIfNeeded
public static void createTableIfNeeded(java.lang.String schemaName, ISchemaAdapter target)
Create the WHOLE_SCHEMA_VERSION table. The table is created in the target data schema, not the admin schema.- Parameters:
schemaName
-target
-
-
dropTable
public static void dropTable(java.lang.String schemaName, ISchemaAdapter target)
Drop the WHOLE_SCHEMA_VERSION table if it exists in the given schema- Parameters:
schemaName
-target
-
-
grantPrivilegesTo
public static void grantPrivilegesTo(ISchemaAdapter target, java.lang.String schemaName, java.lang.String groupName, java.lang.String toUser)
Grant the user privileges so that the row from this table can be read by the $healthcheck custom operation.- Parameters:
target
-groupName
-toUser
-
-
-