Class 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  
    • 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 schemaName
      static 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 schema
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CreateWholeSchemaVersion

        public CreateWholeSchemaVersion()
    • 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 -