<?xml version="1.0" encoding="UTF-8"?><database name="mscmp_syst_authn" schema="ms_syst_data" type="PostgreSQL - 18.0 (Ubuntu 18.0-1.pgdg24.04+3)">
   <tables>
      <table name="syst_access_account_instance_assocs" remarks="Associates access accounts with the instances for which they are allowed to&#10;authenticate to.  Note that being able to authenticate to an instance is not the&#10;same as having authorized rights within the instance; authorization is handled&#10;by the instance directly." schema="ms_syst_data" type="TABLE">
         <column autoUpdated="false" defaultValue="uuidv7()" digits="0" id="0" name="id" nullable="false" remarks="The record's primary key.  The definitive identifier of the record in the&#10;system.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="uuid" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="access_account_id" nullable="false" remarks="The access account which is being granted authentication rights to the given&#10;instance." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_access_account_instance_assocs_access_accounts_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_access_accounts"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="instance_id" nullable="false" remarks="The identity of the instance to which authentication rights is being granted." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_access_account_instance_assocs_instances_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_instances"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="6" id="3" name="access_granted" nullable="true" remarks="The timestamp at which access to the instance was granted and active.&#10;&#10;**General Usage**&#10;&#10;If the access did not require the access invitation process, this value will&#10;typically reflect the creation timestamp of the record.  If the invitation was&#10;required, it will reflect the time when the access account holder actually&#10;accepted the invitation to access the instance." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="4" name="invitation_issued" nullable="true" remarks="When inviting unowned, independent access accounts such as might be used by an&#10;external bookkeeper, the grant of access by the instance owner is&#10;not immediately effective but must also be approved by the access account holder&#10;being granted access.  &#10;&#10;**General Usage**&#10;&#10;The timestamp in this column indicates when the invitation to connect to the&#10;instance was issued. If the value in this column is null, the assumption is that&#10;no invitation was required to grant the access to the access account." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="5" name="invitation_expires" nullable="true" remarks="The timestamp at which the invitation to access a given instance expires." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="6" name="invitation_declined" nullable="true" remarks="The timestamp at which the access account holder explicitly declined the&#10;invitation to access the given instance." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="7" name="diag_timestamp_created" nullable="false" remarks="The database server date/time when the transaction which created the record&#10;started.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="diag_role_created" nullable="false" remarks="The database role which created the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="9" name="diag_timestamp_modified" nullable="false" remarks="The database server date/time when the transaction which modified the record&#10;started.  This field will be the same as diag_timestamp_created for inserted&#10;records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="clock_timestamp()" digits="6" id="10" name="diag_wallclock_modified" nullable="false" remarks="The database server date/time at the moment the record was actually modified.&#10;For long running transactions this time may be significantly later than the&#10;value of diag_timestamp_modified.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="diag_role_modified" nullable="false" remarks="The database role which modified the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="1" digits="0" id="12" name="diag_row_version" nullable="false" remarks="The current version of the row.  The value here indicates how many actual&#10;data changes have been made to the row.  If an update of the row leaves all data&#10;fields the same, disregarding the updates to the diag_* columns, the row version&#10;is not updated, nor are any updates made to the other diag_* columns other than&#10;diag_update_count.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations.&#10;&#10;**Direct Usage**&#10;&#10;This column is frequently used by by application logic to resolve the &quot;dirty&#10;write&quot; issues which can arise from concurrent data changes.  As such any&#10;administrative override of automatic system maintenance of this value should&#10;consider the ramifications on application function." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="13" name="diag_update_count" nullable="false" remarks="Records the number of times the record has been updated regardless as to if&#10;the update actually changed any data.  In this way needless or redundant record&#10;updates can be found.  This row starts at 0 and therefore may be the same as the&#10;diag_row_version - 1.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="19" type="int8" typeCode="-5"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="syst_access_account_instance_assocs_pk" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="syst_access_account_instance_assoc_a_i_udx" unique="true">
            <column ascending="true" name="access_account_id"/>
            <column ascending="true" name="instance_id"/>
         </index>
      </table>
      <table name="syst_access_accounts" remarks="Contains the known login accounts which are used solely for the purpose of&#10;authentication of users.  Authorization is handled on a per-Instance basis&#10;within the application." schema="ms_syst_data" type="TABLE">
         <column autoUpdated="false" defaultValue="uuidv7()" digits="0" id="0" name="id" nullable="false" remarks="The record's primary key.  The definitive identifier of the record in the&#10;system.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="uuid" typeCode="1111">
            <child column="access_account_id" foreignKey="syst_access_account_instance_assocs_access_accounts_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_access_account_instance_assocs"/>
            <child column="access_account_id" foreignKey="syst_credentials_access_accounts_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_credentials"/>
            <child column="access_account_id" foreignKey="syst_identities_access_accounts_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_identities"/>
            <child column="access_account_id" foreignKey="syst_password_history_access_account_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_password_history"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="internal_name" nullable="false" remarks="A candidate key useful for programmatic references to individual records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="external_name" nullable="false" remarks="A non-unique/non-key value used to display to users and external parties where&#10;uniqueness is less of a concern than specific end user presentation." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="owning_owner_id" nullable="true" remarks="Associates the Access Account with a specific Owner.  This allows for access&#10;accounts which are identified and managed exclusively by a given Owner.&#10;&#10;**General Usage**&#10;&#10;When this field is NULL, the assumption is that it's an independent access&#10;account.  An independent Access Account may be used, for example, by third party&#10;accountants that need to access the Instances of different Owners." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_access_accounts_owners_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_owners"/>
         </column>
         <column autoUpdated="false" defaultValue="false" digits="0" id="4" name="allow_global_logins" nullable="false" remarks="Indicates whether or not an Access Account may be used to login outside of the&#10;context of a specific Owner or Instance.  This use case supports Access Accounts&#10;which are independently managed, such as might be the case for external&#10;bookkeepers.&#10;&#10;The need for this distinction arises when considering logins for Access Account&#10;holders such as customers or vendors.  In these cases access to the Owner's&#10;environment should appear to be unique, but they may use the same identifier as&#10;used for a different, but unrelated, Owner.  In this case you have multiple&#10;Access Accounts with possibly the same identifier; to resolve the conflict, it&#10;is required therefore to know which Owner or Instance the Access Accounts holder&#10;is trying to access.  In the allow global case we can just ask the account&#10;holder but in the disallow global case we need to know it in advance.&#10;&#10;Another way to think about global logins is in relation to user interface.  A&#10;global login interface may present the user with a choice of Instance Owners and&#10;then their Instances whereas the non-global login user must go directly to the&#10;login interface for a specific Owner (be that URL or other client-side specific&#10;identification.)&#10;&#10;**General Usage**&#10;&#10;When true, allows an Access Account to log into the system without having an&#10;Owner or Instance specified in the login process.  When false, the Access&#10;Account is more tightly bound to a specific Owner and so only a specific Owner&#10;and Instances should be evaluated at login time." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="access_account_state_id" nullable="false" remarks="The current life-cycle state of the Access Account." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_access_accounts_access_account_states_fk" implied="false" onDeleteCascade="false" schema="ms_syst_data" table="syst_enum_items"/>
         </column>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="6" name="diag_timestamp_created" nullable="false" remarks="The database server date/time when the transaction which created the record&#10;started.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="diag_role_created" nullable="false" remarks="The database role which created the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="8" name="diag_timestamp_modified" nullable="false" remarks="The database server date/time when the transaction which modified the record&#10;started.  This field will be the same as diag_timestamp_created for inserted&#10;records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="clock_timestamp()" digits="6" id="9" name="diag_wallclock_modified" nullable="false" remarks="The database server date/time at the moment the record was actually modified.&#10;For long running transactions this time may be significantly later than the&#10;value of diag_timestamp_modified.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="diag_role_modified" nullable="false" remarks="The database role which modified the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="1" digits="0" id="11" name="diag_row_version" nullable="false" remarks="The current version of the row.  The value here indicates how many actual&#10;data changes have been made to the row.  If an update of the row leaves all data&#10;fields the same, disregarding the updates to the diag_* columns, the row version&#10;is not updated, nor are any updates made to the other diag_* columns other than&#10;diag_update_count.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations.&#10;&#10;**Direct Usage**&#10;&#10;This column is frequently used by by application logic to resolve the &quot;dirty&#10;write&quot; issues which can arise from concurrent data changes.  As such any&#10;administrative override of automatic system maintenance of this value should&#10;consider the ramifications on application function." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="12" name="diag_update_count" nullable="false" remarks="Records the number of times the record has been updated regardless as to if&#10;the update actually changed any data.  In this way needless or redundant record&#10;updates can be found.  This row starts at 0 and therefore may be the same as the&#10;diag_row_version - 1.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="19" type="int8" typeCode="-5"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="syst_access_accounts_pk" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="syst_access_accounts_internal_name_udx" unique="true">
            <column ascending="true" name="internal_name"/>
         </index>
      </table>
      <table name="syst_application_contexts" remarks="Applications are written with certain security and connection&#10;characteristics in mind which correlate to database roles used by the&#10;application for establishing connections.  This table defines the datastore&#10;contexts the application is expecting so that Instance records can be validated&#10;against the expectations." schema="ms_syst_data" type="TABLE">
         <column autoUpdated="false" defaultValue="uuidv7()" digits="0" id="0" name="id" nullable="false" remarks="The record's primary key.  The definitive identifier of the record in the&#10;system.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="uuid" typeCode="1111">
            <child column="application_context_id" foreignKey="syst_instance_contexts_application_contexts_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_instance_contexts"/>
            <child column="application_context_id" foreignKey="syst_instance_type_contexts_application_contexts_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_instance_type_contexts"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="internal_name" nullable="false" remarks="A candidate key useful for programmatic references to individual records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="display_name" nullable="false" remarks="A friendly name and candidate key for the record, suitable for use in user&#10;interactions&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="application_id" nullable="false" remarks="References the ms_syst_data.syst_applications record which owns the&#10;context." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_application_contexts_applications_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_applications"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="description" nullable="false" remarks="A user visible description of the application context, its role in the&#10;application, uses, and any other helpful text." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="false" digits="0" id="5" name="start_context" nullable="false" remarks="Indicates whether or not the system should start the context for any Instances&#10;of the application.&#10;&#10;**General Usage**&#10;&#10;If true, any Instance of the Application will start its&#10;associated context so long as it is enabled at the Instance level.  If false,&#10;the context is disabled for all Instances in the Application regardless of their&#10;individual settings." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="false" digits="0" id="6" name="login_context" nullable="false" remarks="Indicates whether or not the Application Context is used for making&#10;connections to the database.&#10;&#10;**General Usage**&#10;&#10;If true, each associated Instance Context is&#10;created as a role in the database with the LOGIN privilege; if false, the&#10;role is created in the database as a NOLOGIN role.  Most often non-login&#10;Application Contexts are created to serve as the database role owning database&#10;objects." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="false" digits="0" id="7" name="database_owner_context" nullable="false" remarks="Indicates if the Application Context represents the database role used for object&#10;ownership.&#10;&#10;**General Usage**&#10;&#10;If true, the Application Context does represent the ownership role&#10;and should also be defined as a login_context = FALSE context.  If false, the&#10;role is not used for database object ownership.  Note that there should only&#10;ever be one Application Context defined as database_owner_context = TRUE for any&#10;one Application." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="8" name="diag_timestamp_created" nullable="false" remarks="The database server date/time when the transaction which created the record&#10;started.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="diag_role_created" nullable="true" remarks="The database role which created the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="10" name="diag_timestamp_modified" nullable="false" remarks="The database server date/time when the transaction which modified the record&#10;started.  This field will be the same as diag_timestamp_created for inserted&#10;records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="clock_timestamp()" digits="6" id="11" name="diag_wallclock_modified" nullable="false" remarks="The database server date/time at the moment the record was actually modified.&#10;For long running transactions this time may be significantly later than the&#10;value of diag_timestamp_modified.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="diag_role_modified" nullable="true" remarks="The database role which modified the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="1" digits="0" id="13" name="diag_row_version" nullable="false" remarks="The current version of the row.  The value here indicates how many actual&#10;data changes have been made to the row.  If an update of the row leaves all data&#10;fields the same, disregarding the updates to the diag_* columns, the row version&#10;is not updated, nor are any updates made to the other diag_* columns other than&#10;diag_update_count.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations.&#10;&#10;**Direct Usage**&#10;&#10;This column is frequently used by by application logic to resolve the &quot;dirty&#10;write&quot; issues which can arise from concurrent data changes.  As such any&#10;administrative override of automatic system maintenance of this value should&#10;consider the ramifications on application function." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="14" name="diag_update_count" nullable="false" remarks="Records the number of times the record has been updated regardless as to if&#10;the update actually changed any data.  In this way needless or redundant record&#10;updates can be found.  This row starts at 0 and therefore may be the same as the&#10;diag_row_version - 1.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="19" type="int8" typeCode="-5"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="syst_application_contexts_pk" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="syst_application_contexts_display_name_udx" unique="true">
            <column ascending="true" name="display_name"/>
         </index>
         <index name="syst_application_contexts_internal_name_udx" unique="true">
            <column ascending="true" name="internal_name"/>
         </index>
      </table>
      <table name="syst_applications" remarks="Describes the known applications which is managed by the global database and&#10;authentication infrastructure." schema="ms_syst_data" type="TABLE">
         <column autoUpdated="false" defaultValue="uuidv7()" digits="0" id="0" name="id" nullable="false" remarks="The record's primary key.  The definitive identifier of the record in the&#10;system.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="uuid" typeCode="1111">
            <child column="application_id" foreignKey="syst_application_contexts_applications_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_application_contexts"/>
            <child column="application_id" foreignKey="syst_instance_type_applications_applications_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_instance_type_applications"/>
            <child column="application_id" foreignKey="syst_instances_applications_fk" implied="false" onDeleteCascade="false" schema="ms_syst_data" table="syst_instances"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="internal_name" nullable="false" remarks="A candidate key useful for programmatic references to individual records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="display_name" nullable="false" remarks="A friendly name and candidate key for the record, suitable for use in user&#10;interactions&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="syst_description" nullable="false" remarks="A system defined description indicating the purpose and use cases of a given&#10;record.  Text defined in this column is system maintained and should not be&#10;changed under normal circumstances.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="4" name="diag_timestamp_created" nullable="false" remarks="The database server date/time when the transaction which created the record&#10;started.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="diag_role_created" nullable="false" remarks="The database role which created the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="6" name="diag_timestamp_modified" nullable="false" remarks="The database server date/time when the transaction which modified the record&#10;started.  This field will be the same as diag_timestamp_created for inserted&#10;records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="clock_timestamp()" digits="6" id="7" name="diag_wallclock_modified" nullable="false" remarks="The database server date/time at the moment the record was actually modified.&#10;For long running transactions this time may be significantly later than the&#10;value of diag_timestamp_modified.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="diag_role_modified" nullable="false" remarks="The database role which modified the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="1" digits="0" id="9" name="diag_row_version" nullable="false" remarks="The current version of the row.  The value here indicates how many actual&#10;data changes have been made to the row.  If an update of the row leaves all data&#10;fields the same, disregarding the updates to the diag_* columns, the row version&#10;is not updated, nor are any updates made to the other diag_* columns other than&#10;diag_update_count.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations.&#10;&#10;**Direct Usage**&#10;&#10;This column is frequently used by by application logic to resolve the &quot;dirty&#10;write&quot; issues which can arise from concurrent data changes.  As such any&#10;administrative override of automatic system maintenance of this value should&#10;consider the ramifications on application function." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="10" name="diag_update_count" nullable="false" remarks="Records the number of times the record has been updated regardless as to if&#10;the update actually changed any data.  In this way needless or redundant record&#10;updates can be found.  This row starts at 0 and therefore may be the same as the&#10;diag_row_version - 1.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="19" type="int8" typeCode="-5"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="syst_applications_pk" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="syst_applications_display_name_udx" unique="true">
            <column ascending="true" name="display_name"/>
         </index>
         <index name="syst_applications_internal_name_udx" unique="true">
            <column ascending="true" name="internal_name"/>
         </index>
      </table>
      <table name="syst_credentials" remarks="Hosts the Credentials by which a user or external system will prove its&#10;Identity.&#10;&#10;**General Usage**&#10;&#10;Note that not all Credential types are available for authentication with all&#10;Identity types." schema="ms_syst_data" type="TABLE">
         <column autoUpdated="false" defaultValue="uuidv7()" digits="0" id="0" name="id" nullable="false" remarks="The record's primary key.  The definitive identifier of the record in the&#10;system.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="uuid" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="access_account_id" nullable="false" remarks="The Access Account for which the Credential is to be used." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_credentials_access_accounts_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_access_accounts"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="credential_type_id" nullable="false" remarks="The kind of Credential that the record represents.&#10;&#10;**General Usage**&#10;&#10;Note that the behavior and use cases of the Credential may have specific&#10;processing and handling requirements based on the Functional Type of the&#10;Credential ype." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_credentials_credential_types_fk" implied="false" onDeleteCascade="false" schema="ms_syst_data" table="syst_enum_items"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="credential_for_identity_id" nullable="true" remarks="When an Access Account Identity is created for either Identity Validation or&#10;Access Account recovery, a single use Identity is created as well as a single&#10;use Credential.  In this specific case, the one time use Credential and the one&#10;time use Identity are linked.  This is especially important in recovery&#10;scenarios to ensure that only the correct recovery communication can recover the&#10;account.  This field identifies the which Identity is associated with the&#10;Credential.&#10;&#10;For regular use Identities, there are no special Credential requirements that&#10;would be needed to for a link and the value in this column should be null." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_credentials_for_identities_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_identities"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="credential_data" nullable="false" remarks="The actual data which supports verifying the presented Identity in relation to&#10;the Access Account." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="5" name="last_updated" nullable="false" remarks="For Credential types where rules regarding updating may apply, such as common&#10;passwords, this column indicates when the Credential was last updated (timestamp&#10;of last password change, for example).&#10;&#10;**General Usage**&#10;&#10;This field is explicitly not for dating trivial or administrative changes&#10;which don't actually materially change the Credential data; please consult the&#10;appropriate diagnostic fields for those use cases." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="6" name="force_reset" nullable="true" remarks="Indicates whether or not certain Credential types, such as passwords, must be&#10;updated.&#10;&#10;**General Usage**&#10;&#10;When `NOT NULL`, the user must update their Credential on the next login; when&#10;`NULL` updating the Credential is not being administratively forced." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="7" name="diag_timestamp_created" nullable="false" remarks="The database server date/time when the transaction which created the record&#10;started.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="diag_role_created" nullable="false" remarks="The database role which created the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="9" name="diag_timestamp_modified" nullable="false" remarks="The database server date/time when the transaction which modified the record&#10;started.  This field will be the same as diag_timestamp_created for inserted&#10;records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="clock_timestamp()" digits="6" id="10" name="diag_wallclock_modified" nullable="false" remarks="The database server date/time at the moment the record was actually modified.&#10;For long running transactions this time may be significantly later than the&#10;value of diag_timestamp_modified.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="diag_role_modified" nullable="false" remarks="The database role which modified the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="1" digits="0" id="12" name="diag_row_version" nullable="false" remarks="The current version of the row.  The value here indicates how many actual&#10;data changes have been made to the row.  If an update of the row leaves all data&#10;fields the same, disregarding the updates to the diag_* columns, the row version&#10;is not updated, nor are any updates made to the other diag_* columns other than&#10;diag_update_count.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations.&#10;&#10;**Direct Usage**&#10;&#10;This column is frequently used by by application logic to resolve the &quot;dirty&#10;write&quot; issues which can arise from concurrent data changes.  As such any&#10;administrative override of automatic system maintenance of this value should&#10;consider the ramifications on application function." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="13" name="diag_update_count" nullable="false" remarks="Records the number of times the record has been updated regardless as to if&#10;the update actually changed any data.  In this way needless or redundant record&#10;updates can be found.  This row starts at 0 and therefore may be the same as the&#10;diag_row_version - 1.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="19" type="int8" typeCode="-5"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="syst_credentials_pk" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="syst_credentials_udx" unique="true">
            <column ascending="true" name="access_account_id"/>
            <column ascending="true" name="credential_type_id"/>
            <column ascending="true" name="credential_for_identity_id"/>
         </index>
      </table>
      <table name="syst_disallowed_hosts" remarks="A simple listing of &quot;banned&quot; IP address which are not allowed to authenticate&#10;their users to the system.  This registry differs from the syst_*_network_rules&#10;tables in that IP addresses here are registered as the result of automatic&#10;system heuristics whereas the network rules are direct expressions of system&#10;administrator intent.  The timing between these two mechanisms is also different&#10;in that records in this table are evaluated prior to an authentication attempt&#10;and most network rules are processed in the authentication attempt sequence." schema="ms_syst_data" type="TABLE">
         <column autoUpdated="false" defaultValue="uuidv7()" digits="0" id="0" name="id" nullable="false" remarks="The record's primary key.  The definitive identifier of the record in the&#10;system.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="uuid" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="host_address" nullable="false" remarks="The IP address of the host disallowed from attempting to authenticate Access&#10;Accounts." size="2147483647" type="inet" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="2" name="diag_timestamp_created" nullable="false" remarks="The database server date/time when the transaction which created the record&#10;started.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="diag_role_created" nullable="true" remarks="The database role which created the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="4" name="diag_timestamp_modified" nullable="false" remarks="The database server date/time when the transaction which modified the record&#10;started.  This field will be the same as diag_timestamp_created for inserted&#10;records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="clock_timestamp()" digits="6" id="5" name="diag_wallclock_modified" nullable="false" remarks="The database server date/time at the moment the record was actually modified.&#10;For long running transactions this time may be significantly later than the&#10;value of diag_timestamp_modified.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="diag_role_modified" nullable="true" remarks="The database role which modified the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="1" digits="0" id="7" name="diag_row_version" nullable="false" remarks="The current version of the row.  The value here indicates how many actual&#10;data changes have been made to the row.  If an update of the row leaves all data&#10;fields the same, disregarding the updates to the diag_* columns, the row version&#10;is not updated, nor are any updates made to the other diag_* columns other than&#10;diag_update_count.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations.&#10;&#10;**Direct Usage**&#10;&#10;This column is frequently used by by application logic to resolve the &quot;dirty&#10;write&quot; issues which can arise from concurrent data changes.  As such any&#10;administrative override of automatic system maintenance of this value should&#10;consider the ramifications on application function." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="8" name="diag_update_count" nullable="false" remarks="Records the number of times the record has been updated regardless as to if&#10;the update actually changed any data.  In this way needless or redundant record&#10;updates can be found.  This row starts at 0 and therefore may be the same as the&#10;diag_row_version - 1.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="19" type="int8" typeCode="-5"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="syst_disallowed_hosts_pk" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="syst_disallowed_hosts_host_address_udx" unique="true">
            <column ascending="true" name="host_address"/>
         </index>
      </table>
      <table name="syst_disallowed_passwords" remarks="A list of hashed passwords which are disallowed for use in the system when the&#10;password rule to disallow common/known compromised passwords is enabled.&#10;Currently the expectation is that common passwords will be stored as sha1&#10;hashes." schema="ms_syst_data" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="password_hash" nullable="false" remarks="The SHA1 hash of the disallowed password.  The reason for using SHA1 here is&#10;that it is compatible with the &quot;Have I Been Pwned&quot; data and API products.  We&#10;also get some reasonable obscuring of possibly private data." size="2147483647" type="bytea" typeCode="-2"/>
         <primaryKey column="password_hash" sequenceNumberInPK="1"/>
         <index name="syst_disallowed_passwords_pkey" unique="true">
            <column ascending="true" name="password_hash"/>
         </index>
      </table>
      <table name="syst_enum_functional_types" remarks="For those Enumerations requiring Functional Type designation, this table defines&#10;the available types and persists related metadata.  Note that not all&#10;Enumerations require Functional Types." schema="ms_syst_data" type="TABLE">
         <column autoUpdated="false" defaultValue="uuidv7()" digits="0" id="0" name="id" nullable="false" remarks="The record's primary key.  The definitive identifier of the record in the&#10;system.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="uuid" typeCode="1111">
            <child column="functional_type_id" foreignKey="syst_enum_items_enum_functional_type_fk" implied="false" onDeleteCascade="false" schema="ms_syst_data" table="syst_enum_items"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="internal_name" nullable="false" remarks="A candidate key useful for programmatic references to individual records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="display_name" nullable="false" remarks="A friendly name and candidate key for the record, suitable for use in user&#10;interactions&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="external_name" nullable="false" remarks="A non-unique/non-key value used to display to users and external parties where&#10;uniqueness is less of a concern than specific end user presentation." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="enum_id" nullable="false" remarks="A reference to the owning Enumeration of the functional type." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_enum_functional_types_enum_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_enums"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="syst_description" nullable="false" remarks="A system defined description indicating the purpose and use cases of a given&#10;record.  Text defined in this column is system maintained and should not be&#10;changed under normal circumstances.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="user_description" nullable="true" remarks="An optional user defined description of the record and its use cases.  If this&#10;value is not `NULL`, the value will override any `syst_description` defined text&#10;in application user interfaces and other presentations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="7" name="diag_timestamp_created" nullable="false" remarks="The database server date/time when the transaction which created the record&#10;started.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="diag_role_created" nullable="false" remarks="The database role which created the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="9" name="diag_timestamp_modified" nullable="false" remarks="The database server date/time when the transaction which modified the record&#10;started.  This field will be the same as diag_timestamp_created for inserted&#10;records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="clock_timestamp()" digits="6" id="10" name="diag_wallclock_modified" nullable="false" remarks="The database server date/time at the moment the record was actually modified.&#10;For long running transactions this time may be significantly later than the&#10;value of diag_timestamp_modified.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="diag_role_modified" nullable="false" remarks="The database role which modified the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="1" digits="0" id="12" name="diag_row_version" nullable="false" remarks="The current version of the row.  The value here indicates how many actual&#10;data changes have been made to the row.  If an update of the row leaves all data&#10;fields the same, disregarding the updates to the diag_* columns, the row version&#10;is not updated, nor are any updates made to the other diag_* columns other than&#10;diag_update_count.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations.&#10;&#10;**Direct Usage**&#10;&#10;This column is frequently used by by application logic to resolve the &quot;dirty&#10;write&quot; issues which can arise from concurrent data changes.  As such any&#10;administrative override of automatic system maintenance of this value should&#10;consider the ramifications on application function." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="13" name="diag_update_count" nullable="false" remarks="Records the number of times the record has been updated regardless as to if&#10;the update actually changed any data.  In this way needless or redundant record&#10;updates can be found.  This row starts at 0 and therefore may be the same as the&#10;diag_row_version - 1.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="19" type="int8" typeCode="-5"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="syst_enum_functional_types_pk" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="syst_enum_functional_types_display_name_udx" unique="true">
            <column ascending="true" name="display_name"/>
         </index>
         <index name="syst_enum_functional_types_internal_name_udx" unique="true">
            <column ascending="true" name="internal_name"/>
         </index>
      </table>
      <table name="syst_enum_items" remarks="The list of values provided by an Enumeration as well as related behavioral and&#10;informational metadata." schema="ms_syst_data" type="TABLE">
         <column autoUpdated="false" defaultValue="uuidv7()" digits="0" id="0" name="id" nullable="false" remarks="The record's primary key.  The definitive identifier of the record in the&#10;system.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="uuid" typeCode="1111">
            <child column="access_account_state_id" foreignKey="syst_access_accounts_access_account_states_fk" implied="false" onDeleteCascade="false" schema="ms_syst_data" table="syst_access_accounts"/>
            <child column="credential_type_id" foreignKey="syst_credentials_credential_types_fk" implied="false" onDeleteCascade="false" schema="ms_syst_data" table="syst_credentials"/>
            <child column="identity_type_id" foreignKey="syst_identities_identity_types_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_identities"/>
            <child column="instance_type_id" foreignKey="syst_instance_type_applications_instance_types_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_instance_type_applications"/>
            <child column="instance_lifecycle_state_id" foreignKey="syst_instances_enum_instance_lifecycle_state_fk" implied="false" onDeleteCascade="false" schema="ms_syst_data" table="syst_instances"/>
            <child column="instance_type_id" foreignKey="syst_instances_enum_instance_type_fk" implied="false" onDeleteCascade="false" schema="ms_syst_data" table="syst_instances"/>
            <child column="owner_state_id" foreignKey="syst_owner_owner_states_fk" implied="false" onDeleteCascade="false" schema="ms_syst_data" table="syst_owners"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="internal_name" nullable="false" remarks="A candidate key useful for programmatic references to individual records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="display_name" nullable="false" remarks="A friendly name and candidate key for the record, suitable for use in user&#10;interactions&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="external_name" nullable="false" remarks="A non-unique/non-key value used to display to users and external parties where&#10;uniqueness is less of a concern than specific end user presentation." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="enum_id" nullable="false" remarks="The enumeration record with which the value is associated." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_enum_items_enum_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_enums"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="functional_type_id" nullable="true" remarks="If the enumeration requires a functional type, this column references the&#10;functional type associated with the enumeration value record.&#10;&#10;**General Usage**&#10;&#10;Note that not all enumerations require functional types.  If&#10;syst_enum_functional_types records exist for an enumeration, then this column&#10;will be required for any values of that enumeration; if there are no functional&#10;types defined for an enumeration, the this column must remain NULL." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_enum_items_enum_functional_type_fk" implied="false" onDeleteCascade="false" schema="ms_syst_data" table="syst_enum_functional_types"/>
         </column>
         <column autoUpdated="false" defaultValue="false" digits="0" id="6" name="enum_default" nullable="false" remarks="If true, indicates that this value is the default selection from all values&#10;defined for the enumerations.&#10;&#10;**General Usage**&#10;&#10;Note that if a record is inserted or updated in this table with enum_default set&#10;true, and another record already exists for the enumeration with its&#10;enum_default set true, the newly inserted/updated record will take precedence&#10;and the value record previously set to be default will have its enum_default&#10;setting set to false.&#10;&#10;If false then the value record has no special significance relative to&#10;defaulting." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="false" digits="0" id="7" name="functional_type_default" nullable="false" remarks="If true, the value record is the default selection for any of a specific&#10;fucntional type.  This is helpful in situations where a progression of state is&#10;automatically processed by the system and the state is represented by an&#10;enumeration.&#10;&#10;**General Usage**&#10;&#10;Note that if a record is inserted or updated in this table with its&#10;functional_type_default set true, and another record already exists for the&#10;enumeration/functional type combination with its functional_type_default set&#10;true, the newly inserted/updated record will take precedence and the value&#10;record previously set to be default will have its functional_type_default&#10;setting set to false.&#10;&#10;In cases where there are no functional types, this value should simply remain&#10;false." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="false" digits="0" id="8" name="syst_defined" nullable="false" remarks="Values of `TRUE` in this column indicate that the record is considered a&#10;&quot;System Defined&quot; record, a record which is created and primarily maintained by&#10;the system using automated processes.  A value of `FALSE` indicates that the&#10;record is considered a &quot;User Defined&quot; record which is maintained by user actions&#10;in the application.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="true" digits="0" id="9" name="user_maintainable" nullable="false" remarks="If a record is system defined (see the `syst_defined` column), there may be&#10;some user data maintenance operations permitted in some cases.  If the value of&#10;this column for a record is `TRUE` and the record is also &quot;System Defined&quot;, then&#10;permitted user maintenance operations are available for the record.  If the&#10;record is system defined and the value of this column is `FALSE`, no user&#10;maintenance is allowed.  If the record is not system defined, the value in this&#10;column will have no meaning or effect; user defined records may set this value&#10;`TRUE` as a simple information point indicating that the record is user&#10;maintainable.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="syst_description" nullable="false" remarks="A system defined description indicating the purpose and use cases of a given&#10;record.  Text defined in this column is system maintained and should not be&#10;changed under normal circumstances.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="user_description" nullable="true" remarks="An optional user defined description of the record and its use cases.  If this&#10;value is not `NULL`, the value will override any `syst_description` defined text&#10;in application user interfaces and other presentations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="sort_order" nullable="false" remarks="Indicates the sort ordering of the particular value record with the lowest value&#10;sorting first.&#10;&#10;**General Usage**&#10;&#10;When a value record for an enumeration is inserted or updated and this&#10;column is being set to a value which equals another enumeration value record for&#10;the same enumeration, the system assumes that the new record is being set to&#10;precede the existing record and it will be set to sort after the newly&#10;inserted/updated enumeration value." size="5" type="int2" typeCode="5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="syst_options" nullable="true" remarks="Extended options and metadata which describe the behavior and meaning of the&#10;specific value within the enumeration.&#10;&#10;**General Usage**&#10;&#10;The owning syst_enums record's default_syst_options column will indicate&#10;what syst_options are required or available and establishes default values for&#10;them." size="2147483647" type="jsonb" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="user_options" nullable="true" remarks="Extended user defined options, similar to syst_options, but for the purpose of&#10;driving custom functionality." size="2147483647" type="jsonb" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="15" name="diag_timestamp_created" nullable="false" remarks="The database server date/time when the transaction which created the record&#10;started.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="diag_role_created" nullable="false" remarks="The database role which created the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="17" name="diag_timestamp_modified" nullable="false" remarks="The database server date/time when the transaction which modified the record&#10;started.  This field will be the same as diag_timestamp_created for inserted&#10;records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="clock_timestamp()" digits="6" id="18" name="diag_wallclock_modified" nullable="false" remarks="The database server date/time at the moment the record was actually modified.&#10;For long running transactions this time may be significantly later than the&#10;value of diag_timestamp_modified.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="19" name="diag_role_modified" nullable="false" remarks="The database role which modified the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="1" digits="0" id="20" name="diag_row_version" nullable="false" remarks="The current version of the row.  The value here indicates how many actual&#10;data changes have been made to the row.  If an update of the row leaves all data&#10;fields the same, disregarding the updates to the diag_* columns, the row version&#10;is not updated, nor are any updates made to the other diag_* columns other than&#10;diag_update_count.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations.&#10;&#10;**Direct Usage**&#10;&#10;This column is frequently used by by application logic to resolve the &quot;dirty&#10;write&quot; issues which can arise from concurrent data changes.  As such any&#10;administrative override of automatic system maintenance of this value should&#10;consider the ramifications on application function." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="21" name="diag_update_count" nullable="false" remarks="Records the number of times the record has been updated regardless as to if&#10;the update actually changed any data.  In this way needless or redundant record&#10;updates can be found.  This row starts at 0 and therefore may be the same as the&#10;diag_row_version - 1.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="19" type="int8" typeCode="-5"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="syst_enum_items_pk" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="syst_enum_items_display_name_udx" unique="true">
            <column ascending="true" name="display_name"/>
         </index>
         <index name="syst_enum_items_internal_name_udx" unique="true">
            <column ascending="true" name="internal_name"/>
         </index>
      </table>
      <table name="syst_enums" remarks="Enumerates the enumerations known to the system along with additional metadata&#10;useful in applying them appropriately." schema="ms_syst_data" type="TABLE">
         <column autoUpdated="false" defaultValue="uuidv7()" digits="0" id="0" name="id" nullable="false" remarks="The record's primary key.  The definitive identifier of the record in the&#10;system.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="uuid" typeCode="1111">
            <child column="enum_id" foreignKey="syst_enum_functional_types_enum_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_enum_functional_types"/>
            <child column="enum_id" foreignKey="syst_enum_items_enum_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_enum_items"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="internal_name" nullable="false" remarks="A candidate key useful for programmatic references to individual records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="display_name" nullable="false" remarks="A friendly name and candidate key for the record, suitable for use in user&#10;interactions&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="syst_description" nullable="false" remarks="A system defined description indicating the purpose and use cases of a given&#10;record.  Text defined in this column is system maintained and should not be&#10;changed under normal circumstances.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="user_description" nullable="true" remarks="An optional user defined description of the record and its use cases.  If this&#10;value is not `NULL`, the value will override any `syst_description` defined text&#10;in application user interfaces and other presentations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="false" digits="0" id="5" name="syst_defined" nullable="false" remarks="Values of `TRUE` in this column indicate that the record is considered a&#10;&quot;System Defined&quot; record, a record which is created and primarily maintained by&#10;the system using automated processes.  A value of `FALSE` indicates that the&#10;record is considered a &quot;User Defined&quot; record which is maintained by user actions&#10;in the application.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="true" digits="0" id="6" name="user_maintainable" nullable="false" remarks="If a record is system defined (see the `syst_defined` column), there may be&#10;some user data maintenance operations permitted in some cases.  If the value of&#10;this column for a record is `TRUE` and the record is also &quot;System Defined&quot;, then&#10;permitted user maintenance operations are available for the record.  If the&#10;record is system defined and the value of this column is `FALSE`, no user&#10;maintenance is allowed.  If the record is not system defined, the value in this&#10;column will have no meaning or effect; user defined records may set this value&#10;`TRUE` as a simple information point indicating that the record is user&#10;maintainable.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="default_syst_options" nullable="true" remarks="Establishes the expected extended system options along with default values if&#10;applicable.&#10;&#10;**General Usage**&#10;&#10;Note that this setting is used to both validate and set defaults in the&#10;`syst_enum_items.syst_options` column." size="2147483647" type="jsonb" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="default_user_options" nullable="true" remarks="Allows a user to set the definition of syst_enum_items.user_options values and&#10;provide defaults for those values if appropriate." size="2147483647" type="jsonb" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="9" name="diag_timestamp_created" nullable="false" remarks="The database server date/time when the transaction which created the record&#10;started.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="diag_role_created" nullable="false" remarks="The database role which created the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="11" name="diag_timestamp_modified" nullable="false" remarks="The database server date/time when the transaction which modified the record&#10;started.  This field will be the same as diag_timestamp_created for inserted&#10;records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="clock_timestamp()" digits="6" id="12" name="diag_wallclock_modified" nullable="false" remarks="The database server date/time at the moment the record was actually modified.&#10;For long running transactions this time may be significantly later than the&#10;value of diag_timestamp_modified.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="diag_role_modified" nullable="false" remarks="The database role which modified the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="1" digits="0" id="14" name="diag_row_version" nullable="false" remarks="The current version of the row.  The value here indicates how many actual&#10;data changes have been made to the row.  If an update of the row leaves all data&#10;fields the same, disregarding the updates to the diag_* columns, the row version&#10;is not updated, nor are any updates made to the other diag_* columns other than&#10;diag_update_count.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations.&#10;&#10;**Direct Usage**&#10;&#10;This column is frequently used by by application logic to resolve the &quot;dirty&#10;write&quot; issues which can arise from concurrent data changes.  As such any&#10;administrative override of automatic system maintenance of this value should&#10;consider the ramifications on application function." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="15" name="diag_update_count" nullable="false" remarks="Records the number of times the record has been updated regardless as to if&#10;the update actually changed any data.  In this way needless or redundant record&#10;updates can be found.  This row starts at 0 and therefore may be the same as the&#10;diag_row_version - 1.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="19" type="int8" typeCode="-5"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="syst_enums_pk" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="syst_enums_display_name_udx" unique="true">
            <column ascending="true" name="display_name"/>
         </index>
         <index name="syst_enums_internal_name_udx" unique="true">
            <column ascending="true" name="internal_name"/>
         </index>
      </table>
      <table name="syst_global_network_rules" remarks="Defines firewall-like rules that are global in scope indicating which IP&#10;addresses are allowed to attempt authentication and which are not.  This also&#10;includes the concept of global defaults applied to new Owner IP address rules.&#10;These rules are applied in their defined ordering prior to all other rule sets." schema="ms_syst_data" type="TABLE">
         <column autoUpdated="false" defaultValue="uuidv7()" digits="0" id="0" name="id" nullable="false" remarks="The record's primary key.  The definitive identifier of the record in the&#10;system.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="uuid" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="ordering" nullable="false" remarks="Defines the order in which IP rules are applied.  Lower values are applied&#10;prior to higher values.&#10;&#10;**General Usage**&#10;&#10;All records are ordered using unique ordering values within each owner value.&#10;When a new Owner Network Rule is inserted with the ordering value of an&#10;existing Owner Network Rule record for the same Owner, the system will assume&#10;the new record should be &quot;inserted before&quot; the existing record.  Therefore the&#10;existing record will be reordered behind the new record by incrementing the&#10;existing record's ordering value by one.  This reordering process happens&#10;recursively until there are no ordering value conflicts for any of an Owner's&#10;Network Rule records." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="functional_type" nullable="false" remarks="Indicates how the system will interpret the IP address rule.&#10;&#10;&#10;**General Usage**&#10;&#10;The valid functional types are:&#10;&#10;  * `allow` - the rule is explicitly allowing an IP address, network, or range&#10;    of IP addresses to continue in the authentication process.&#10;&#10;  * `deny` - the rule is explicitly rejecting an IP address, network, or range&#10;    of IP addresses from the authentication process." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="ip_host_or_network" nullable="true" remarks="An IPv4 or IPv6 IP address or network block expressed using standard CIDR&#10;notation.&#10;&#10;**General Usage**&#10;&#10;If this value is given you should not provide an IP host address range in the&#10;ip_host_range_lower/ip_host_range_upper columns.  Providing range column values&#10;when this column is not null will result in a consistency check failure." size="2147483647" type="inet" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="ip_host_range_lower" nullable="true" remarks="An IPv4 or IPv6 IP host address which is the lower bound (inclusive) of a&#10;range of IP addresses.&#10;&#10;**General Usage**&#10;&#10;If the value in this column is not null a value must also be provided for the&#10;ip_host_range_upper column.  Both ip_host_range_lower and ip_host_range_upper&#10;must be of the same IP family (IPv4 or IPv6)." size="2147483647" type="inet" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="ip_host_range_upper" nullable="true" remarks="An IPv4 or IPv6 IP host address which is the upper bound (inclusive) of a&#10;range of IP addresses.&#10;&#10;**General Usage**&#10;&#10;If the value in this column is not null a value must also be provided for the&#10;ip_host_range_lower column.  Both ip_host_range_lower and ip_host_range_upper&#10;must be of the same IP family (IPv4 or IPv6)." size="2147483647" type="inet" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="6" name="diag_timestamp_created" nullable="false" remarks="The database server date/time when the transaction which created the record&#10;started.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="diag_role_created" nullable="true" remarks="The database role which created the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="8" name="diag_timestamp_modified" nullable="false" remarks="The database server date/time when the transaction which modified the record&#10;started.  This field will be the same as diag_timestamp_created for inserted&#10;records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="clock_timestamp()" digits="6" id="9" name="diag_wallclock_modified" nullable="false" remarks="The database server date/time at the moment the record was actually modified.&#10;For long running transactions this time may be significantly later than the&#10;value of diag_timestamp_modified.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="diag_role_modified" nullable="true" remarks="The database role which modified the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="1" digits="0" id="11" name="diag_row_version" nullable="false" remarks="The current version of the row.  The value here indicates how many actual&#10;data changes have been made to the row.  If an update of the row leaves all data&#10;fields the same, disregarding the updates to the diag_* columns, the row version&#10;is not updated, nor are any updates made to the other diag_* columns other than&#10;diag_update_count.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations.&#10;&#10;**Direct Usage**&#10;&#10;This column is frequently used by by application logic to resolve the &quot;dirty&#10;write&quot; issues which can arise from concurrent data changes.  As such any&#10;administrative override of automatic system maintenance of this value should&#10;consider the ramifications on application function." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="12" name="diag_update_count" nullable="false" remarks="Records the number of times the record has been updated regardless as to if&#10;the update actually changed any data.  In this way needless or redundant record&#10;updates can be found.  This row starts at 0 and therefore may be the same as the&#10;diag_row_version - 1.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="19" type="int8" typeCode="-5"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="syst_global_network_rules_pk" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="syst_global_network_rules_ordering_udx" unique="true">
            <column ascending="true" name="ordering"/>
         </index>
         <checkConstraint constraint="(functional_type = ANY (ARRAY['allow'::text, 'deny'::text]))" name="syst_global_network_rules_functional_type_chk"/>
         <checkConstraint constraint="(((ip_host_or_network IS NOT NULL) AND (ip_host_range_lower IS NULL) AND (ip_host_range_upper IS NULL)) OR ((ip_host_or_network IS NULL) AND (ip_host_range_lower IS NOT NULL) AND (ip_host_range_upper IS NOT NULL)))" name="syst_global_network_rules_host_or_range_chk"/>
         <checkConstraint constraint="(family(ip_host_range_lower) = family(ip_host_range_upper))" name="syst_global_network_rules_ip_range_family_chk"/>
      </table>
      <table name="syst_global_password_rules" remarks="Establishes a minimum standard for password credential complexity globally.&#10;Individual Owners may define more restrictive complexity requirements for their&#10;own accounts and instances, but may not weaken those defined globally." schema="ms_syst_data" type="TABLE">
         <column autoUpdated="false" defaultValue="uuidv7()" digits="0" id="0" name="id" nullable="false" remarks="The record's primary key.  The definitive identifier of the record in the&#10;system.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="uuid" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="int4range(8, 64, '[]'::text)" digits="0" id="1" name="password_length" nullable="false" remarks="An integer range of acceptable password lengths with the lower bound&#10;representing the minimum length and the upper bound representing the maximum&#10;password length.&#10;&#10;**General Usage**&#10;&#10;A zero or negative value on either bound indicates that the bound check is&#10;disabled.  Note that disabling a bound may still result in a bounds check using&#10;the application defined default for the bound.&#10;&#10;Length is determined on a per character basis, not a per byte basis." size="2147483647" type="int4range" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="'00:00:00'::interval" digits="6" id="2" name="max_age" nullable="false" remarks="An interval indicating the maximum allowed age of a password.  Any password&#10;older than this interval will typically result in the user being forced to&#10;update their password prior to being allowed access to other functionality. The&#10;specific user workflow will depend on the implementation details of application.&#10;&#10;**General Usage**&#10;&#10;An interval of 0 time disables the check and passwords may be of any age." size="49" type="interval" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="3" name="require_upper_case" nullable="false" remarks="Establishes the minimum number of upper case characters that are required to be&#10;present in the password.&#10;&#10;**General Usage**&#10;&#10;Setting this value to 0 disables the requirement for upper case characters." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="4" name="require_lower_case" nullable="false" remarks="Setting this value to 0 disables the requirement for lower case characters." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="5" name="require_numbers" nullable="false" remarks="Establishes the minimum number of numeric characters that are required to be&#10;present in the password.&#10;&#10;**General Usage**&#10;&#10;Setting this value to 0 disables the requirement for numeric characters." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="6" name="require_symbols" nullable="false" remarks="Establishes the minimum number of non-alphanumeric characters that are required&#10;to be present in the password.&#10;&#10;**General Usage**&#10;&#10;Setting this value to 0 disables the requirement for non-alphanumeric&#10;characters." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="7" name="disallow_recently_used" nullable="false" remarks="When passwords are changed, this value determines how many prior passwords&#10;should be checked in order to prevent password re-use.&#10;&#10;**General Usage**&#10;&#10;Setting this value to zero or a negative number will disable the recently used&#10;password check." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="true" digits="0" id="8" name="disallow_compromised" nullable="false" remarks="When true new passwords submitted through the change password process will be&#10;checked against a list of common passwords and passwords known to have been&#10;compromised and disallow their use as password credentials in the system.&#10;&#10;**General Usage**&#10;&#10;When false submitted passwords are not checked as being common or against known&#10;compromised passwords; such passwords would therefore be usable in the system." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="true" digits="0" id="9" name="require_mfa" nullable="false" remarks="When true, an approved multi-factor authentication method must be used in&#10;addition to the password credential." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="ARRAY[]::text[]" digits="0" id="10" name="allowed_mfa_types" nullable="false" remarks="A array of the approved multi-factor authentication methods." size="2147483647" type="_text" typeCode="2003"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="11" name="diag_timestamp_created" nullable="false" remarks="The database server date/time when the transaction which created the record&#10;started.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="diag_role_created" nullable="true" remarks="The database role which created the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="13" name="diag_timestamp_modified" nullable="false" remarks="The database server date/time when the transaction which modified the record&#10;started.  This field will be the same as diag_timestamp_created for inserted&#10;records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="clock_timestamp()" digits="6" id="14" name="diag_wallclock_modified" nullable="false" remarks="The database server date/time at the moment the record was actually modified.&#10;For long running transactions this time may be significantly later than the&#10;value of diag_timestamp_modified.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="diag_role_modified" nullable="true" remarks="The database role which modified the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="1" digits="0" id="16" name="diag_row_version" nullable="false" remarks="The current version of the row.  The value here indicates how many actual&#10;data changes have been made to the row.  If an update of the row leaves all data&#10;fields the same, disregarding the updates to the diag_* columns, the row version&#10;is not updated, nor are any updates made to the other diag_* columns other than&#10;diag_update_count.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations.&#10;&#10;**Direct Usage**&#10;&#10;This column is frequently used by by application logic to resolve the &quot;dirty&#10;write&quot; issues which can arise from concurrent data changes.  As such any&#10;administrative override of automatic system maintenance of this value should&#10;consider the ramifications on application function." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="17" name="diag_update_count" nullable="false" remarks="Records the number of times the record has been updated regardless as to if&#10;the update actually changed any data.  In this way needless or redundant record&#10;updates can be found.  This row starts at 0 and therefore may be the same as the&#10;diag_row_version - 1.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="19" type="int8" typeCode="-5"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="syst_global_password_rules_pk" unique="true">
            <column ascending="true" name="id"/>
         </index>
      </table>
      <table name="syst_identities" remarks="The identities with which access accounts are identified to the system.  The&#10;most common example of an identity would be a user name such as an email&#10;address." schema="ms_syst_data" type="TABLE">
         <column autoUpdated="false" defaultValue="uuidv7()" digits="0" id="0" name="id" nullable="false" remarks="The record's primary key.  The definitive identifier of the record in the&#10;system.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="uuid" typeCode="1111">
            <child column="credential_for_identity_id" foreignKey="syst_credentials_for_identities_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_credentials"/>
            <child column="validates_identity_id" foreignKey="syst_identities_validates_identities_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_identities"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="access_account_id" nullable="false" remarks="The ID of the access account to be identified the identifier record." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_identities_access_accounts_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_access_accounts"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="identity_type_id" nullable="false" remarks="The kind of identifier being described by the record.&#10;&#10;**General Usage**&#10;&#10;Note that this value influences the kind of credentials that can be used to&#10;complete the authentication process." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_identities_identity_types_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_enum_items"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="account_identifier" nullable="false" remarks="The actual Identifier which identifies a user or system to the system.&#10;&#10;**General Usage**&#10;&#10;Identifiers of the same Identifier Type are unique to the Owner/Access&#10;Account combination. All Unowned Access Accounts are considered as being in the&#10;same Owner group for this purpose." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="4" name="validated" nullable="true" remarks="The timestamp at which the identity was validated for use.&#10;&#10;**General Usage**&#10;&#10;  Depending on the requirements of the identity functional type, the timestamp&#10;here may be set as the time of the identity creation or it may set when the&#10;access account holder actually makes a formal verification.  A null value here&#10;indicates that the identity is not validated by the access account holder and is&#10;not able to be used for authentication to the system." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="validates_identity_id" nullable="true" remarks="Each identity requiring validation will require its own validation.&#10;&#10;**General Usage**&#10;&#10;Since validation requests are also single use identities, we need to know which&#10;permanent identifier is being validate.  This column points to the identifier&#10;that is being validated.  When the current identifier is not being used for&#10;validation, this field is null." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_identities_validates_identities_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_identities"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="6" id="6" name="validation_requested" nullable="true" remarks="The timestamp on which the validation request was issued to the access account&#10;holder.&#10;&#10;**General Usage**&#10;&#10;This value will be null if the identity did not require validation." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="7" name="identity_expires" nullable="true" remarks="The timestamp at which the identity record expires.&#10;&#10;**General Usage**&#10;&#10;For validation and recovery identities this would be the time of&#10;validation/recovery request expiration.  For perpetual identity types, this&#10;value will be NULL." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="external_name" nullable="true" remarks="A non-unique/non-key value used to display to users and external parties where&#10;uniqueness is less of a concern than specific end user presentation." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="9" name="diag_timestamp_created" nullable="false" remarks="The database server date/time when the transaction which created the record&#10;started.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="diag_role_created" nullable="false" remarks="The database role which created the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="11" name="diag_timestamp_modified" nullable="false" remarks="The database server date/time when the transaction which modified the record&#10;started.  This field will be the same as diag_timestamp_created for inserted&#10;records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="clock_timestamp()" digits="6" id="12" name="diag_wallclock_modified" nullable="false" remarks="The database server date/time at the moment the record was actually modified.&#10;For long running transactions this time may be significantly later than the&#10;value of diag_timestamp_modified.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="diag_role_modified" nullable="false" remarks="The database role which modified the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="1" digits="0" id="14" name="diag_row_version" nullable="false" remarks="The current version of the row.  The value here indicates how many actual&#10;data changes have been made to the row.  If an update of the row leaves all data&#10;fields the same, disregarding the updates to the diag_* columns, the row version&#10;is not updated, nor are any updates made to the other diag_* columns other than&#10;diag_update_count.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations.&#10;&#10;**Direct Usage**&#10;&#10;This column is frequently used by by application logic to resolve the &quot;dirty&#10;write&quot; issues which can arise from concurrent data changes.  As such any&#10;administrative override of automatic system maintenance of this value should&#10;consider the ramifications on application function." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="15" name="diag_update_count" nullable="false" remarks="Records the number of times the record has been updated regardless as to if&#10;the update actually changed any data.  In this way needless or redundant record&#10;updates can be found.  This row starts at 0 and therefore may be the same as the&#10;diag_row_version - 1.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="19" type="int8" typeCode="-5"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="syst_identities_pk" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="syst_identities_access_account_idx" unique="false">
            <column ascending="true" name="access_account_id"/>
         </index>
         <index name="syst_identities_account_type_identifier_idx" unique="false">
            <column ascending="true" name="identity_type_id"/>
            <column ascending="true" name="access_account_id"/>
            <column ascending="true" name="account_identifier"/>
         </index>
         <index name="syst_identities_validates_identities_udx" unique="true">
            <column ascending="true" name="validates_identity_id"/>
         </index>
      </table>
      <table name="syst_instance_contexts" remarks="Instance specific settings which determine how each Instance connects to the&#10;defined Application Contexts." schema="ms_syst_data" type="TABLE">
         <column autoUpdated="false" defaultValue="uuidv7()" digits="0" id="0" name="id" nullable="false" remarks="The record's primary key.  The definitive identifier of the record in the&#10;system.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="uuid" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="internal_name" nullable="false" remarks="A candidate key useful for programmatic references to individual records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="instance_id" nullable="false" remarks="Identifies the parent Instance for which Instance Contexts are being defined." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_instance_contexts_instances_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_instances"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="application_context_id" nullable="false" remarks="Identifies the Application Context which is being defined for the Instance." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_instance_contexts_application_contexts_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_application_contexts"/>
         </column>
         <column autoUpdated="false" defaultValue="false" digits="0" id="4" name="start_context" nullable="false" remarks="Indicates whether the Instance Context should be started on Instance start.&#10;&#10;**General Usage**&#10;&#10;If true, indicates that the Instance Context should be started, so long as the&#10;Application Context record is also set to allow context starting.  If false, the&#10;Instance Context not be started, even if the related Application Context is set&#10;to allow context starts." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="5" name="db_pool_size" nullable="false" remarks="If the Application Context is a login datastore context, this value establishes&#10;how many database connections to open on behalf of this Instance Context." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="context_code" nullable="false" remarks="An Instance Context specific series of bytes which are used in algorithmic&#10;credential generation." size="2147483647" type="bytea" typeCode="-2"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="7" name="diag_timestamp_created" nullable="false" remarks="The database server date/time when the transaction which created the record&#10;started.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="diag_role_created" nullable="true" remarks="The database role which created the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="9" name="diag_timestamp_modified" nullable="false" remarks="The database server date/time when the transaction which modified the record&#10;started.  This field will be the same as diag_timestamp_created for inserted&#10;records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="clock_timestamp()" digits="6" id="10" name="diag_wallclock_modified" nullable="false" remarks="The database server date/time at the moment the record was actually modified.&#10;For long running transactions this time may be significantly later than the&#10;value of diag_timestamp_modified.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="diag_role_modified" nullable="true" remarks="The database role which modified the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="1" digits="0" id="12" name="diag_row_version" nullable="false" remarks="The current version of the row.  The value here indicates how many actual&#10;data changes have been made to the row.  If an update of the row leaves all data&#10;fields the same, disregarding the updates to the diag_* columns, the row version&#10;is not updated, nor are any updates made to the other diag_* columns other than&#10;diag_update_count.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations.&#10;&#10;**Direct Usage**&#10;&#10;This column is frequently used by by application logic to resolve the &quot;dirty&#10;write&quot; issues which can arise from concurrent data changes.  As such any&#10;administrative override of automatic system maintenance of this value should&#10;consider the ramifications on application function." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="13" name="diag_update_count" nullable="false" remarks="Records the number of times the record has been updated regardless as to if&#10;the update actually changed any data.  In this way needless or redundant record&#10;updates can be found.  This row starts at 0 and therefore may be the same as the&#10;diag_row_version - 1.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="19" type="int8" typeCode="-5"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="syst_instance_contexts_pk" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="syst_instance_contexts_internal_name_udx" unique="true">
            <column ascending="true" name="internal_name"/>
         </index>
         <checkConstraint constraint="(db_pool_size &gt;= 0)" name="syst_instance_contexts_db_pool_size_chk"/>
      </table>
      <table name="syst_instance_network_rules" remarks="Defines firewall-like rules, scoped to specific instances, indicating which IP&#10;addresses are allowed to attempt authentication and which are not.  These rules&#10;are applied in their defined order after all global_network_rules and&#10;owner_network_rules." schema="ms_syst_data" type="TABLE">
         <column autoUpdated="false" defaultValue="uuidv7()" digits="0" id="0" name="id" nullable="false" remarks="The record's primary key.  The definitive identifier of the record in the&#10;system.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="uuid" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="instance_id" nullable="false" remarks="The database identifier of the Instance record for whom the Network Rule is&#10;being defined." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_instance_network_rules_instance_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_instances"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="ordering" nullable="false" remarks="Defines the order in which IP rules are applied.  Lower values are applied&#10;prior to higher values.&#10;&#10;**General Usage**&#10;&#10;All records are ordered using unique ordering values within each Instance value.&#10;When a new Instance Network Rule is inserted with the ordering value of an&#10;existing Instance Network Rule record for the same Owner, the system will assume&#10;the new record should be &quot;inserted before&quot; the existing record.  Therefore the&#10;existing record will be reordered behind the new record by incrementing the&#10;existing record's ordering value by one.  This reordering process happens&#10;recursively until there are no ordering value conflicts for any of an Instance's&#10;Network Rule records." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="functional_type" nullable="false" remarks="Indicates how the system will interpret the IP address rule.&#10;&#10;**General Usage**&#10;&#10;The valid functional types are:&#10;&#10;  * `allow` - the rule is explicitly allowing an IP address, network, or range&#10;    of IP addresses to continue in the authentication process.&#10;&#10;  * `deny` - the rule is explicitly rejecting an IP address, network, or range&#10;    of IP addresses from the authentication process." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="ip_host_or_network" nullable="true" remarks="An IPv4 or IPv6 IP address or network block expressed using standard CIDR&#10;notation.&#10;&#10;**General Usage**&#10;&#10;If this value is given you should not provide an IP host address range in the&#10;ip_host_range_lower/ip_host_range_upper columns.  Providing range column values&#10;when this column is not null will result in a consistency check failure." size="2147483647" type="inet" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="ip_host_range_lower" nullable="true" remarks="An IPv4 or IPv6 IP host address which is the lower bound (inclusive) of a&#10;range of IP addresses.&#10;&#10;**General Usage**&#10;&#10;If the value in this column is not null a value must also be provided for the&#10;ip_host_range_upper column.  Both ip_host_range_lower and ip_host_range_upper&#10;must be of the same IP family (IPv4 or IPv6)." size="2147483647" type="inet" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="ip_host_range_upper" nullable="true" remarks="An IPv4 or IPv6 IP host address which is the upper bound (inclusive) of a&#10;range of IP addresses.&#10;&#10;**General Usage**&#10;&#10;If the value in this column is not null a value must also be provided for the&#10;ip_host_range_lower column.  Both ip_host_range_lower and ip_host_range_upper&#10;must be of the same IP family (IPv4 or IPv6)." size="2147483647" type="inet" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="7" name="diag_timestamp_created" nullable="false" remarks="The database server date/time when the transaction which created the record&#10;started.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="diag_role_created" nullable="true" remarks="The database role which created the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="9" name="diag_timestamp_modified" nullable="false" remarks="The database server date/time when the transaction which modified the record&#10;started.  This field will be the same as diag_timestamp_created for inserted&#10;records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="clock_timestamp()" digits="6" id="10" name="diag_wallclock_modified" nullable="false" remarks="The database server date/time at the moment the record was actually modified.&#10;For long running transactions this time may be significantly later than the&#10;value of diag_timestamp_modified.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="diag_role_modified" nullable="true" remarks="The database role which modified the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="1" digits="0" id="12" name="diag_row_version" nullable="false" remarks="The current version of the row.  The value here indicates how many actual&#10;data changes have been made to the row.  If an update of the row leaves all data&#10;fields the same, disregarding the updates to the diag_* columns, the row version&#10;is not updated, nor are any updates made to the other diag_* columns other than&#10;diag_update_count.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations.&#10;&#10;**Direct Usage**&#10;&#10;This column is frequently used by by application logic to resolve the &quot;dirty&#10;write&quot; issues which can arise from concurrent data changes.  As such any&#10;administrative override of automatic system maintenance of this value should&#10;consider the ramifications on application function." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="13" name="diag_update_count" nullable="false" remarks="Records the number of times the record has been updated regardless as to if&#10;the update actually changed any data.  In this way needless or redundant record&#10;updates can be found.  This row starts at 0 and therefore may be the same as the&#10;diag_row_version - 1.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="19" type="int8" typeCode="-5"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="syst_instance_network_rules_pk" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="syst_instance_network_rules_instance_ordering_udx" unique="true">
            <column ascending="true" name="instance_id"/>
            <column ascending="true" name="ordering"/>
         </index>
         <checkConstraint constraint="(functional_type = ANY (ARRAY['allow'::text, 'deny'::text]))" name="syst_instance_network_rules_functional_type_chk"/>
         <checkConstraint constraint="(((ip_host_or_network IS NOT NULL) AND (ip_host_range_lower IS NULL) AND (ip_host_range_upper IS NULL)) OR ((ip_host_or_network IS NULL) AND (ip_host_range_lower IS NOT NULL) AND (ip_host_range_upper IS NOT NULL)))" name="syst_instance_network_rules_host_or_range_chk"/>
         <checkConstraint constraint="(family(ip_host_range_lower) = family(ip_host_range_upper))" name="syst_instance_network_rules_ip_range_family_chk"/>
      </table>
      <table name="syst_instance_type_applications" remarks="A many-to-many relation indicating which Instance Types are usable for each&#10;Application.&#10;&#10;**General Usage**&#10;&#10;Note that creating ms_syst_data.syst_application_contexts records prior to&#10;inserting an Instance Type/Application association into this table is&#10;recommended as default Instance Type Context records can be created&#10;automatically on INSERT into this table so long as the supporting data is&#10;available.  After insert here, manipulations of what Contexts Applications&#10;require must be handled manually." schema="ms_syst_data" type="TABLE">
         <column autoUpdated="false" defaultValue="uuidv7()" digits="0" id="0" name="id" nullable="false" remarks="The record's primary key.  The definitive identifier of the record in the&#10;system.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="uuid" typeCode="1111">
            <child column="instance_type_application_id" foreignKey="syst_instance_type_contexts_inst_type_app_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_instance_type_contexts"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="instance_type_id" nullable="false" remarks="A reference to the Instance Type being associated to an Application." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_instance_type_applications_instance_types_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_enum_items"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="application_id" nullable="false" remarks="A reference to the Application being associated with the Instance Type." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_instance_type_applications_applications_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_applications"/>
         </column>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="3" name="diag_timestamp_created" nullable="false" remarks="The database server date/time when the transaction which created the record&#10;started.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="diag_role_created" nullable="true" remarks="The database role which created the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="5" name="diag_timestamp_modified" nullable="false" remarks="The database server date/time when the transaction which modified the record&#10;started.  This field will be the same as diag_timestamp_created for inserted&#10;records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="clock_timestamp()" digits="6" id="6" name="diag_wallclock_modified" nullable="false" remarks="The database server date/time at the moment the record was actually modified.&#10;For long running transactions this time may be significantly later than the&#10;value of diag_timestamp_modified.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="diag_role_modified" nullable="true" remarks="The database role which modified the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="1" digits="0" id="8" name="diag_row_version" nullable="false" remarks="The current version of the row.  The value here indicates how many actual&#10;data changes have been made to the row.  If an update of the row leaves all data&#10;fields the same, disregarding the updates to the diag_* columns, the row version&#10;is not updated, nor are any updates made to the other diag_* columns other than&#10;diag_update_count.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations.&#10;&#10;**Direct Usage**&#10;&#10;This column is frequently used by by application logic to resolve the &quot;dirty&#10;write&quot; issues which can arise from concurrent data changes.  As such any&#10;administrative override of automatic system maintenance of this value should&#10;consider the ramifications on application function." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="9" name="diag_update_count" nullable="false" remarks="Records the number of times the record has been updated regardless as to if&#10;the update actually changed any data.  In this way needless or redundant record&#10;updates can be found.  This row starts at 0 and therefore may be the same as the&#10;diag_row_version - 1.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="19" type="int8" typeCode="-5"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="syst_instance_type_applications_pk" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="syst_instance_type_applications_instance_type_applications_udx" unique="true">
            <column ascending="true" name="instance_type_id"/>
            <column ascending="true" name="application_id"/>
         </index>
      </table>
      <table name="syst_instance_type_contexts" remarks="Establishes Instance Type defaults for each of an Application's defined&#10;datastore contexts.&#10;&#10;**General Usage**&#10;&#10;In practice, these records are used in the creation of Instance Context records,&#10;but do not establish a direct relationship; records in this table simply inform&#10;us what Instance Contexts should exist and give us default values to use in&#10;their creation." schema="ms_syst_data" type="TABLE">
         <column autoUpdated="false" defaultValue="uuidv7()" digits="0" id="0" name="id" nullable="false" remarks="The record's primary key.  The definitive identifier of the record in the&#10;system.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="uuid" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="instance_type_application_id" nullable="false" remarks="The Instance Type/Application association to which the context definition&#10;belongs." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_instance_type_contexts_inst_type_app_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_instance_type_applications"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="application_context_id" nullable="false" remarks="The Application Context which is being represented in the Instance Type." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_instance_type_contexts_application_contexts_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_application_contexts"/>
         </column>
         <column autoUpdated="false" defaultValue="0" digits="0" id="3" name="default_db_pool_size" nullable="false" remarks="A default pool size which is assigned to new Instances of the Instance Type&#10;unless the creator of the Instance specifies a different value." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="4" name="diag_timestamp_created" nullable="false" remarks="The database server date/time when the transaction which created the record&#10;started.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="diag_role_created" nullable="true" remarks="The database role which created the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="6" name="diag_timestamp_modified" nullable="false" remarks="The database server date/time when the transaction which modified the record&#10;started.  This field will be the same as diag_timestamp_created for inserted&#10;records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="clock_timestamp()" digits="6" id="7" name="diag_wallclock_modified" nullable="false" remarks="The database server date/time at the moment the record was actually modified.&#10;For long running transactions this time may be significantly later than the&#10;value of diag_timestamp_modified.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="diag_role_modified" nullable="true" remarks="The database role which modified the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="1" digits="0" id="9" name="diag_row_version" nullable="false" remarks="The current version of the row.  The value here indicates how many actual&#10;data changes have been made to the row.  If an update of the row leaves all data&#10;fields the same, disregarding the updates to the diag_* columns, the row version&#10;is not updated, nor are any updates made to the other diag_* columns other than&#10;diag_update_count.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations.&#10;&#10;**Direct Usage**&#10;&#10;This column is frequently used by by application logic to resolve the &quot;dirty&#10;write&quot; issues which can arise from concurrent data changes.  As such any&#10;administrative override of automatic system maintenance of this value should&#10;consider the ramifications on application function." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="10" name="diag_update_count" nullable="false" remarks="Records the number of times the record has been updated regardless as to if&#10;the update actually changed any data.  In this way needless or redundant record&#10;updates can be found.  This row starts at 0 and therefore may be the same as the&#10;diag_row_version - 1.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="19" type="int8" typeCode="-5"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="syst_instance_type_contexts_pk" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="syst_instance_type_contexts_instance_types_applications_udx" unique="true">
            <column ascending="true" name="instance_type_application_id"/>
            <column ascending="true" name="application_context_id"/>
         </index>
         <checkConstraint constraint="(default_db_pool_size &gt;= 0)" name="syst_instance_type_contexts_default_db_pool_size_chk"/>
      </table>
      <table name="syst_instances" remarks="Defines known application instances and provides their configuration settings." schema="ms_syst_data" type="TABLE">
         <column autoUpdated="false" defaultValue="uuidv7()" digits="0" id="0" name="id" nullable="false" remarks="The record's primary key.  The definitive identifier of the record in the&#10;system.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="uuid" typeCode="1111">
            <child column="instance_id" foreignKey="syst_access_account_instance_assocs_instances_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_access_account_instance_assocs"/>
            <child column="instance_id" foreignKey="syst_instance_contexts_instances_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_instance_contexts"/>
            <child column="instance_id" foreignKey="syst_instance_network_rules_instance_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_instance_network_rules"/>
            <child column="owning_instance_id" foreignKey="syst_instances_owning_instance_fk" implied="false" onDeleteCascade="false" schema="ms_syst_data" table="syst_instances"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="internal_name" nullable="false" remarks="A candidate key useful for programmatic references to individual records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="display_name" nullable="false" remarks="A friendly name and candidate key for the record, suitable for use in user&#10;interactions&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="application_id" nullable="false" remarks="Indicates an instance of which application is being described by the record." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_instances_applications_fk" implied="false" onDeleteCascade="false" schema="ms_syst_data" table="syst_applications"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="instance_type_id" nullable="false" remarks="Indicates the type of the instance.  This can designate instances as being&#10;production or non-production, or make other functional differences between&#10;instances created for different reasons based on the assigned instance type." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_instances_enum_instance_type_fk" implied="false" onDeleteCascade="false" schema="ms_syst_data" table="syst_enum_items"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="instance_lifecycle_state_id" nullable="false" remarks="Establishes the current life-cycle state of the instance record.  This can&#10;determine functionality such as if the instance is usable, visible, or if it may&#10;be purged from the database completely." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_instances_enum_instance_lifecycle_state_fk" implied="false" onDeleteCascade="false" schema="ms_syst_data" table="syst_enum_items"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="owner_id" nullable="false" remarks="Identifies the owner of the instance.  The owner is the entity which&#10;commissioned the instance and is the &quot;user&quot; of the instance.  Owners have&#10;nominal management rights over their instances, such as which access accounts&#10;and which credential types are allowed to be used to authenticate to the owner's&#10;instances." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_instances_owners_fk" implied="false" onDeleteCascade="false" schema="ms_syst_data" table="syst_owners"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="owning_instance_id" nullable="true" remarks="In some cases, an instance is considered subordinate to another instance.  For&#10;example, consider a production environment and a related sandbox environment.&#10;The existence of the sandbox doesn't have real meaning without being associated&#10;with some sort of production instance where the real work is performed.  This&#10;kind of association becomes clearer in SaaS environments where a primary&#10;instance is contracted for, but other supporting instances, such as a sandbox,&#10;should follow certain account related actions of the primary." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_instances_owning_instance_fk" implied="false" onDeleteCascade="false" schema="ms_syst_data" table="syst_instances"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="dbserver_name" nullable="true" remarks="Identifies on which database server the instance is hosted. If empty, no&#10;server has been assigned and the instance is unstartable." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="instance_code" nullable="false" remarks="This is a random sequence of bytes intended for use in certain algorithmic&#10;credential generation routines.&#10;&#10;**General Usage**&#10;&#10;Note that losing this value may prevent the Instance from being started due to&#10;bad credentials; there may be other consequences as well." size="2147483647" type="bytea" typeCode="-2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="instance_options" nullable="true" remarks="A key/value store of values which define application or instance specific&#10;options." size="2147483647" type="jsonb" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="11" name="diag_timestamp_created" nullable="false" remarks="The database server date/time when the transaction which created the record&#10;started.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="diag_role_created" nullable="false" remarks="The database role which created the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="13" name="diag_timestamp_modified" nullable="false" remarks="The database server date/time when the transaction which modified the record&#10;started.  This field will be the same as diag_timestamp_created for inserted&#10;records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="clock_timestamp()" digits="6" id="14" name="diag_wallclock_modified" nullable="false" remarks="The database server date/time at the moment the record was actually modified.&#10;For long running transactions this time may be significantly later than the&#10;value of diag_timestamp_modified.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="diag_role_modified" nullable="false" remarks="The database role which modified the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="1" digits="0" id="16" name="diag_row_version" nullable="false" remarks="The current version of the row.  The value here indicates how many actual&#10;data changes have been made to the row.  If an update of the row leaves all data&#10;fields the same, disregarding the updates to the diag_* columns, the row version&#10;is not updated, nor are any updates made to the other diag_* columns other than&#10;diag_update_count.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations.&#10;&#10;**Direct Usage**&#10;&#10;This column is frequently used by by application logic to resolve the &quot;dirty&#10;write&quot; issues which can arise from concurrent data changes.  As such any&#10;administrative override of automatic system maintenance of this value should&#10;consider the ramifications on application function." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="17" name="diag_update_count" nullable="false" remarks="Records the number of times the record has been updated regardless as to if&#10;the update actually changed any data.  In this way needless or redundant record&#10;updates can be found.  This row starts at 0 and therefore may be the same as the&#10;diag_row_version - 1.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="19" type="int8" typeCode="-5"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="syst_instances_pk" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="syst_instances_display_name_udx" unique="true">
            <column ascending="true" name="display_name"/>
         </index>
         <index name="syst_instances_internal_name_udx" unique="true">
            <column ascending="true" name="internal_name"/>
         </index>
         <checkConstraint constraint="((owning_instance_id IS NULL) OR (owning_instance_id &lt;&gt; id))" name="syst_instances_self_ownership_chk"/>
      </table>
      <table name="syst_owner_network_rules" remarks="Defines firewall-like rules, scoped to specific owners, indicating which IP&#10;addresses are allowed to attempt authentication and which are not.  These rules&#10;are applied in their defined order after all global_network_rules and before all&#10;instance_network_rules." schema="ms_syst_data" type="TABLE">
         <column autoUpdated="false" defaultValue="uuidv7()" digits="0" id="0" name="id" nullable="false" remarks="The record's primary key.  The definitive identifier of the record in the&#10;system.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="uuid" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="owner_id" nullable="false" remarks="The database identifier of the Owner record for whom the Network Rule is&#10;being defined." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_owner_network_rules_owner_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_owners"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="ordering" nullable="false" remarks="Defines the order in which IP rules are applied.  Lower values are applied&#10;prior to higher values.&#10;&#10;**General Usage**&#10;&#10;All records are ordered using unique ordering values within each owner value.&#10;When a new Owner Network Rule is inserted with the ordering value of an&#10;existing Owner Network Rule record for the same Owner, the system will assume&#10;the new record should be &quot;inserted before&quot; the existing record.  Therefore the&#10;existing record will be reordered behind the new record by incrementing the&#10;existing record's ordering value by one.  This reordering process happens&#10;recursively until there are no ordering value conflicts for any of an Owner's&#10;Network Rule records." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="functional_type" nullable="false" remarks="Indicates how the system will interpret the IP address rule.&#10;&#10;&#10;**General Usage**&#10;&#10;The valid functional types are:&#10;&#10;  * `allow` - the rule is explicitly allowing an IP address, network, or range of&#10;  IP addresses to continue in the authentication process.&#10;&#10;  * `deny` - the rule is explicitly rejecting an IP address, network, or range of&#10;  IP addresses from the authentication process." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="ip_host_or_network" nullable="true" remarks="An IPv4 or IPv6 IP address or network block expressed using standard CIDR&#10;notation.&#10;&#10;**General Usage**&#10;&#10;If this value is given you should not provide an IP host address range in the&#10;ip_host_range_lower/ip_host_range_upper columns.  Providing range column values&#10;when this column is not null will result in a consistency check failure." size="2147483647" type="inet" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="ip_host_range_lower" nullable="true" remarks="An IPv4 or IPv6 IP host address which is the lower bound (inclusive) of a&#10;range of IP addresses.&#10;&#10;**General Usage**&#10;&#10;If the value in this column is not null a value must also be provided for the&#10;ip_host_range_upper column.  Both ip_host_range_lower and ip_host_range_upper&#10;must be of the same IP family (IPv4 or IPv6)." size="2147483647" type="inet" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="ip_host_range_upper" nullable="true" remarks="An IPv4 or IPv6 IP host address which is the upper bound (inclusive) of a&#10;range of IP addresses.&#10;&#10;**General Usage**&#10;&#10;If the value in this column is not null a value must also be provided for the&#10;ip_host_range_lower column.  Both ip_host_range_lower and ip_host_range_upper&#10;must be of the same IP family (IPv4 or IPv6)." size="2147483647" type="inet" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="7" name="diag_timestamp_created" nullable="false" remarks="The database server date/time when the transaction which created the record&#10;started.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="diag_role_created" nullable="true" remarks="The database role which created the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="9" name="diag_timestamp_modified" nullable="false" remarks="The database server date/time when the transaction which modified the record&#10;started.  This field will be the same as diag_timestamp_created for inserted&#10;records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="clock_timestamp()" digits="6" id="10" name="diag_wallclock_modified" nullable="false" remarks="The database server date/time at the moment the record was actually modified.&#10;For long running transactions this time may be significantly later than the&#10;value of diag_timestamp_modified.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="diag_role_modified" nullable="true" remarks="The database role which modified the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="1" digits="0" id="12" name="diag_row_version" nullable="false" remarks="The current version of the row.  The value here indicates how many actual&#10;data changes have been made to the row.  If an update of the row leaves all data&#10;fields the same, disregarding the updates to the diag_* columns, the row version&#10;is not updated, nor are any updates made to the other diag_* columns other than&#10;diag_update_count.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations.&#10;&#10;**Direct Usage**&#10;&#10;This column is frequently used by by application logic to resolve the &quot;dirty&#10;write&quot; issues which can arise from concurrent data changes.  As such any&#10;administrative override of automatic system maintenance of this value should&#10;consider the ramifications on application function." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="13" name="diag_update_count" nullable="false" remarks="Records the number of times the record has been updated regardless as to if&#10;the update actually changed any data.  In this way needless or redundant record&#10;updates can be found.  This row starts at 0 and therefore may be the same as the&#10;diag_row_version - 1.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="19" type="int8" typeCode="-5"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="syst_owner_network_rules_pk" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="syst_owner_network_rules_owner_ordering_udx" unique="true">
            <column ascending="true" name="owner_id"/>
            <column ascending="true" name="ordering"/>
         </index>
         <checkConstraint constraint="(functional_type = ANY (ARRAY['allow'::text, 'deny'::text]))" name="syst_owner_network_rules_functional_type_chk"/>
         <checkConstraint constraint="(((ip_host_or_network IS NOT NULL) AND (ip_host_range_lower IS NULL) AND (ip_host_range_upper IS NULL)) OR ((ip_host_or_network IS NULL) AND (ip_host_range_lower IS NOT NULL) AND (ip_host_range_upper IS NOT NULL)))" name="syst_owner_network_rules_host_or_range_chk"/>
         <checkConstraint constraint="(family(ip_host_range_lower) = family(ip_host_range_upper))" name="syst_owner_network_rules_ip_range_family_chk"/>
      </table>
      <table name="syst_owner_password_rules" remarks="Defines the password credential complexity standard for a given Owner.  While&#10;Owners may define stricter standards than the global password credential&#10;complexity standard, looser standards than the global will not have any effect&#10;and the global standard will be used instead." schema="ms_syst_data" type="TABLE">
         <column autoUpdated="false" defaultValue="uuidv7()" digits="0" id="0" name="id" nullable="false" remarks="The record's primary key.  The definitive identifier of the record in the&#10;system.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="uuid" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="owner_id" nullable="false" remarks="Defines the relationship with the specific Owner for whom the password rule is&#10;being defined." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_owner_password_rules_owner_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_owners"/>
         </column>
         <column autoUpdated="false" defaultValue="int4range(8, 64, '[]'::text)" digits="0" id="2" name="password_length" nullable="false" remarks="An integer range of acceptable password lengths with the lower bound&#10;representing the minimum length and the upper bound representing the maximum&#10;password length.&#10;&#10;**General Usage**&#10;&#10;A zero or negative value on either bound indicates that the bound check is&#10;disabled.  Note that disabling a bound may still result in a bounds check using&#10;the application defined default for the bound.&#10;&#10;Length is determined on a per character basis, not a per byte basis." size="2147483647" type="int4range" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="'00:00:00'::interval" digits="6" id="3" name="max_age" nullable="false" remarks="An interval indicating the maximum allowed age of a password.  Any password&#10;older than this interval will typically result in the user being forced to&#10;update their password prior to being allowed access to other functionality. The&#10;specific user workflow will depend on the implementation details of application.&#10;&#10;**General Usage**&#10;&#10;An interval of 0 time disables the check and passwords may be of any age." size="49" type="interval" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="4" name="require_upper_case" nullable="false" remarks="Establishes the minimum number of upper case characters that are required to be&#10;present in the password.&#10;&#10;**General Usage**&#10;&#10;Setting this value to 0 disables the requirement for upper case characters." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="5" name="require_lower_case" nullable="false" remarks="Setting this value to 0 disables the requirement for lower case characters." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="6" name="require_numbers" nullable="false" remarks="Establishes the minimum number of numeric characters that are required to be&#10;present in the password.&#10;&#10;**General Usage**&#10;&#10;Setting this value to 0 disables the requirement for numeric characters." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="7" name="require_symbols" nullable="false" remarks="Establishes the minimum number of non-alphanumeric characters that are required&#10;to be present in the password.&#10;&#10;**General Usage**&#10;&#10;Setting this value to 0 disables the requirement for non-alphanumeric&#10;characters." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="8" name="disallow_recently_used" nullable="false" remarks="When passwords are changed, this value determines how many prior passwords&#10;should be checked in order to prevent password re-use.&#10;&#10;**General Usage**&#10;&#10;Setting this value to zero or a negative number will disable the recently used&#10;password check." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="true" digits="0" id="9" name="disallow_compromised" nullable="false" remarks="When true new passwords submitted through the change password process will be&#10;checked against a list of common passwords and passwords known to have been&#10;compromised and disallow their use as password credentials in the system.&#10;&#10;**General Usage**&#10;&#10;When false submitted passwords are not checked as being common or against known&#10;compromised passwords; such passwords would therefore be usable in the system." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="true" digits="0" id="10" name="require_mfa" nullable="false" remarks="When true, an approved multi-factor authentication method must be used in&#10;addition to the password credential." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="ARRAY[]::text[]" digits="0" id="11" name="allowed_mfa_types" nullable="false" remarks="A array of the approved multi-factor authentication methods." size="2147483647" type="_text" typeCode="2003"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="12" name="diag_timestamp_created" nullable="false" remarks="The database server date/time when the transaction which created the record&#10;started.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="diag_role_created" nullable="true" remarks="The database role which created the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="14" name="diag_timestamp_modified" nullable="false" remarks="The database server date/time when the transaction which modified the record&#10;started.  This field will be the same as diag_timestamp_created for inserted&#10;records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="clock_timestamp()" digits="6" id="15" name="diag_wallclock_modified" nullable="false" remarks="The database server date/time at the moment the record was actually modified.&#10;For long running transactions this time may be significantly later than the&#10;value of diag_timestamp_modified.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="diag_role_modified" nullable="true" remarks="The database role which modified the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="1" digits="0" id="17" name="diag_row_version" nullable="false" remarks="The current version of the row.  The value here indicates how many actual&#10;data changes have been made to the row.  If an update of the row leaves all data&#10;fields the same, disregarding the updates to the diag_* columns, the row version&#10;is not updated, nor are any updates made to the other diag_* columns other than&#10;diag_update_count.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations.&#10;&#10;**Direct Usage**&#10;&#10;This column is frequently used by by application logic to resolve the &quot;dirty&#10;write&quot; issues which can arise from concurrent data changes.  As such any&#10;administrative override of automatic system maintenance of this value should&#10;consider the ramifications on application function." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="18" name="diag_update_count" nullable="false" remarks="Records the number of times the record has been updated regardless as to if&#10;the update actually changed any data.  In this way needless or redundant record&#10;updates can be found.  This row starts at 0 and therefore may be the same as the&#10;diag_row_version - 1.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="19" type="int8" typeCode="-5"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="syst_owner_password_rules_pk" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="syst_owner_password_rules_owner_udx" unique="true">
            <column ascending="true" name="owner_id"/>
         </index>
      </table>
      <table name="syst_owners" remarks="Identifies instance owners.  Instance owners are typically the clients which&#10;have commissioned the use of an application instance." schema="ms_syst_data" type="TABLE">
         <column autoUpdated="false" defaultValue="uuidv7()" digits="0" id="0" name="id" nullable="false" remarks="The record's primary key.  The definitive identifier of the record in the&#10;system.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="uuid" typeCode="1111">
            <child column="owning_owner_id" foreignKey="syst_access_accounts_owners_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_access_accounts"/>
            <child column="owner_id" foreignKey="syst_instances_owners_fk" implied="false" onDeleteCascade="false" schema="ms_syst_data" table="syst_instances"/>
            <child column="owner_id" foreignKey="syst_owner_network_rules_owner_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_owner_network_rules"/>
            <child column="owner_id" foreignKey="syst_owner_password_rules_owner_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_owner_password_rules"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="internal_name" nullable="false" remarks="A candidate key useful for programmatic references to individual records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="display_name" nullable="false" remarks="A friendly name and candidate key for the record, suitable for use in user&#10;interactions&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="owner_state_id" nullable="false" remarks="Establishes the current life-cycle state in which Instance Owner record&#10;currently resides." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_owner_owner_states_fk" implied="false" onDeleteCascade="false" schema="ms_syst_data" table="syst_enum_items"/>
         </column>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="4" name="diag_timestamp_created" nullable="false" remarks="The database server date/time when the transaction which created the record&#10;started.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="diag_role_created" nullable="false" remarks="The database role which created the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="6" name="diag_timestamp_modified" nullable="false" remarks="The database server date/time when the transaction which modified the record&#10;started.  This field will be the same as diag_timestamp_created for inserted&#10;records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="clock_timestamp()" digits="6" id="7" name="diag_wallclock_modified" nullable="false" remarks="The database server date/time at the moment the record was actually modified.&#10;For long running transactions this time may be significantly later than the&#10;value of diag_timestamp_modified.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="diag_role_modified" nullable="false" remarks="The database role which modified the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="1" digits="0" id="9" name="diag_row_version" nullable="false" remarks="The current version of the row.  The value here indicates how many actual&#10;data changes have been made to the row.  If an update of the row leaves all data&#10;fields the same, disregarding the updates to the diag_* columns, the row version&#10;is not updated, nor are any updates made to the other diag_* columns other than&#10;diag_update_count.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations.&#10;&#10;**Direct Usage**&#10;&#10;This column is frequently used by by application logic to resolve the &quot;dirty&#10;write&quot; issues which can arise from concurrent data changes.  As such any&#10;administrative override of automatic system maintenance of this value should&#10;consider the ramifications on application function." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="10" name="diag_update_count" nullable="false" remarks="Records the number of times the record has been updated regardless as to if&#10;the update actually changed any data.  In this way needless or redundant record&#10;updates can be found.  This row starts at 0 and therefore may be the same as the&#10;diag_row_version - 1.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="19" type="int8" typeCode="-5"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="syst_owners_pk" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="syst_owners_display_name_udx" unique="true">
            <column ascending="true" name="display_name"/>
         </index>
         <index name="syst_owners_internal_name_udx" unique="true">
            <column ascending="true" name="internal_name"/>
         </index>
      </table>
      <table name="syst_password_history" remarks="Keeps the history of access account prior passwords for enforcing the reuse&#10;password rule." schema="ms_syst_data" type="TABLE">
         <column autoUpdated="false" defaultValue="uuidv7()" digits="0" id="0" name="id" nullable="false" remarks="The record's primary key.  The definitive identifier of the record in the&#10;system.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="uuid" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="access_account_id" nullable="false" remarks="The Access Account to which the password history record belongs." size="2147483647" type="uuid" typeCode="1111">
            <parent column="id" foreignKey="syst_password_history_access_account_fk" implied="false" onDeleteCascade="true" schema="ms_syst_data" table="syst_access_accounts"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="credential_data" nullable="false" remarks="The previously hashed password recorded for reuse comparisons.&#10;&#10;**General Usage**&#10;&#10;This is the same format as the existing active password credential." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="3" name="diag_timestamp_created" nullable="false" remarks="The database server date/time when the transaction which created the record&#10;started.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="diag_role_created" nullable="true" remarks="The database role which created the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="5" name="diag_timestamp_modified" nullable="false" remarks="The database server date/time when the transaction which modified the record&#10;started.  This field will be the same as diag_timestamp_created for inserted&#10;records.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="clock_timestamp()" digits="6" id="6" name="diag_wallclock_modified" nullable="false" remarks="The database server date/time at the moment the record was actually modified.&#10;For long running transactions this time may be significantly later than the&#10;value of diag_timestamp_modified.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="diag_role_modified" nullable="true" remarks="The database role which modified the record.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="1" digits="0" id="8" name="diag_row_version" nullable="false" remarks="The current version of the row.  The value here indicates how many actual&#10;data changes have been made to the row.  If an update of the row leaves all data&#10;fields the same, disregarding the updates to the diag_* columns, the row version&#10;is not updated, nor are any updates made to the other diag_* columns other than&#10;diag_update_count.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations.&#10;&#10;**Direct Usage**&#10;&#10;This column is frequently used by by application logic to resolve the &quot;dirty&#10;write&quot; issues which can arise from concurrent data changes.  As such any&#10;administrative override of automatic system maintenance of this value should&#10;consider the ramifications on application function." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="9" name="diag_update_count" nullable="false" remarks="Records the number of times the record has been updated regardless as to if&#10;the update actually changed any data.  In this way needless or redundant record&#10;updates can be found.  This row starts at 0 and therefore may be the same as the&#10;diag_row_version - 1.&#10;&#10;**General Usage**&#10;&#10;This column is system maintained and should be considered read only in normal&#10;operations." size="19" type="int8" typeCode="-5"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="syst_password_history_pk" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="syst_password_history_access_account_idx" unique="false">
            <column ascending="true" name="access_account_id"/>
         </index>
      </table>
   </tables>
   <routines>
      <routine dataAccess="MODIFIES" deterministic="false" name="trig_a_d_syst_credentials_delete_identity()" returnType="trigger" securityType="INVOKER" type="FUNCTION">
         <comment><![CDATA[Deletes the syst_identities record associated with a newly deleted
syst_credentials record.

For those credential types that expect a relationship to syst_identities via the
syst_credentials.credential_for_identity_id column, the specific identifier and
credential data are closely related and updates to one or the other makes no
sense.  The correct process for updating such a pair is to delete both of the
existing identity and credential records and simply generate a new pair.
Deleting identity records achieves this goal via the constraint on the
credential_for_identity_id definition (ON DELETE CASCADE), but deleting a
credential has no automatic deletion feature thus this trigger.

**Trigger Function Details**:

  * **Supported Timing**: `AFTER`

  * **Supported Operations**: `DELETE`]]></comment>
         <definition language="plpgsql"><![CDATA[-- File:        trig_a_d_syst_credentials_delete_identity.eex.sql
-- Location:    musebms/database/components/system/mscmp_syst_authn/ms_syst_data/syst_credentials/trig_a_d_syst_credentials_delete_identity.eex.sql
-- Project:     Muse Systems Business Management System
--
-- Copyright © Lima Buttgereit Holdings LLC d/b/a Muse Systems
-- This file may include content copyrighted and licensed from third parties.
--
-- See the LICENSE file in the project root for license terms and conditions.
-- See the NOTICE file in the project root for copyright ownership information.
--
-- muse.information@musesystems.com :: https://muse.systems

DECLARE

BEGIN
    -- Note that currently for all credential types which expect a
    -- credential_for_identity_id value, the correct course of action here is to
    -- delete the associated identity record.  If this assumption should change,
    -- such as if we should directly associate email identities with password
    -- credentials, this logic will need to consider the credential type since
    -- emails would not be deleted in all scenarios (passwords are recoverable).

    DELETE FROM ms_syst_data.syst_identities WHERE id = old.credential_for_identity_id;

    RETURN NULL;

END;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="trig_a_i_syst_instance_type_apps_create_inst_type_contexts()" returnType="trigger" securityType="INVOKER" type="FUNCTION">
         <comment><![CDATA[When a new association between an Application and an Instance Type is made by
inserting a record into this table, Instance Type Contexts are automatically
created by this function based on the Application Context records defined at the
time of INSERT into this table.

**Trigger Function Details**:

  * **Supported Timing**: `AFTER`

  * **Supported Operations**: `INSERT`

**General Usage**

The default default_db_pool_size value is 0.

After the fact changes to Contexts must be managed manually.]]></comment>
         <definition language="plpgsql"><![CDATA[-- File:        trig_a_i_syst_instance_type_apps_create_inst_type_contexts.eex.sql
-- Location:    musebms/database/components/system/mscmp_syst_instance/ms_syst_data/syst_instance_type_applications/trig_a_i_syst_instance_type_apps_create_inst_type_contexts.eex.sql
-- Project:     Muse Systems Business Management System
--
-- Copyright © Lima Buttgereit Holdings LLC d/b/a Muse Systems
-- This file may include content copyrighted and licensed from third parties.
--
-- See the LICENSE file in the project root for license terms and conditions.
-- See the NOTICE file in the project root for copyright ownership information.
--
-- muse.information@musesystems.com  :: https://muse.systems

BEGIN

    INSERT INTO ms_syst_data.syst_instance_type_contexts
        ( instance_type_application_id, application_context_id, default_db_pool_size )
    SELECT
        new.id
      , id
      , 0
    FROM ms_syst_data.syst_application_contexts
    WHERE application_id = new.application_id;

    RETURN new;
END;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="trig_a_i_syst_instances_create_instance_contexts()" returnType="trigger" securityType="INVOKER" type="FUNCTION">
         <comment/>
         <definition language="plpgsql"><![CDATA[-- File:        trig_a_i_syst_instances_create_instance_contexts.eex.sql
-- Location:    musebms/database/components/system/mscmp_syst_instance/ms_syst_data/syst_instances/trig_a_i_syst_instances_create_instance_contexts.eex.sql
-- Project:     Muse Systems Business Management System
--
-- Copyright © Lima Buttgereit Holdings LLC d/b/a Muse Systems
-- This file may include content copyrighted and licensed from third parties.
--
-- See the LICENSE file in the project root for license terms and conditions.
-- See the NOTICE file in the project root for copyright ownership information.
--
-- muse.information@musesystems.com  :: https://muse.systems

BEGIN

    INSERT INTO ms_syst_data.syst_instance_contexts
        ( internal_name
        , instance_id
        , application_context_id
        , start_context
        , db_pool_size
        , context_code )
    SELECT
        new.internal_name || '_' || sac.internal_name
      , new.id
      , sac.id
      , sac.login_context
      , sitc.default_db_pool_size
      , public.gen_random_bytes( 16 )
    FROM
        ms_syst_data.syst_owners so,
        ms_syst_data.syst_application_contexts sac
            JOIN ms_syst_data.syst_instance_type_contexts sitc
                ON sitc.application_context_id = sac.id
            JOIN ms_syst_data.syst_applications sa
                ON sa.id = sac.application_id
            JOIN ms_syst_data.syst_instance_type_applications sita
                ON sita.id = sitc.instance_type_application_id
    WHERE
          so.id = new.owner_id
      AND sita.instance_type_id = new.instance_type_id
      AND sa.id = new.application_id;

    RETURN new;

END;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="trig_a_iu_syst_enum_items_maintain_sort_order()" returnType="trigger" securityType="INVOKER" type="FUNCTION">
         <comment><![CDATA[Automatically maintains the sort order of syst_enum_item records in cases where
sort ordering collides with existing syst_enum_items records for the same
enum_id.

**Trigger Function Details**:

  * **Supported Timing**: `AFTER`

  * **Supported Operations**: `INSERT`, `UPDATE`

**General Usage**

On insert or update when the new sort_order value matches that of an existing
record for the enumeration, the system will sort the match record after the
new/updated record. This will cascade for all syst_enum_items records matching
the enum_id until the last one is updated.]]></comment>
         <definition language="plpgsql"><![CDATA[-- File:        trig_a_iu_syst_enum_items_maintain_sort_order.eex.sql
-- Location:    musebms/database/components/system/mscmp_syst_enums/ms_syst_data/syst_enum_items/trig_a_iu_syst_enum_items_maintain_sort_order.eex.sql
-- Project:     Muse Systems Business Management System
--
-- Copyright © Lima Buttgereit Holdings LLC d/b/a Muse Systems
-- This file may include content copyrighted and licensed from third parties.
--
-- See the LICENSE file in the project root for license terms and conditions.
-- See the NOTICE file in the project root for copyright ownership information.
--
-- muse.information@musesystems.com  :: https://muse.systems

BEGIN

    UPDATE ms_syst_data.syst_enum_items
    SET sort_order = sort_order + 1
    WHERE enum_id = new.enum_id AND sort_order = new.sort_order AND id != new.id;

    RETURN NULL;

END;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="trig_a_iu_syst_global_network_rule_ordering()" returnType="trigger" securityType="INVOKER" type="FUNCTION">
         <comment><![CDATA[Ensures that the ordering of network rules is maintained and that ordering
values are not duplicated.

**Trigger Function Details**:

  * **Supported Timing**: `AFTER`

  * **Supported Operations**: `INSERT`, `UPDATE`]]></comment>
         <definition language="plpgsql"><![CDATA[-- File:        trig_a_iu_syst_global_network_rule_ordering.eex.sql
-- Location:    musebms/database/components/system/mscmp_syst_authn/ms_syst_data/syst_global_network_rules/trig_a_iu_syst_global_network_rule_ordering.eex.sql
-- Project:     Muse Systems Business Management System
--
-- Copyright © Lima Buttgereit Holdings LLC d/b/a Muse Systems
-- This file may include content copyrighted and licensed from third parties.
--
-- See the LICENSE file in the project root for license terms and conditions.
-- See the NOTICE file in the project root for copyright ownership information.
--
-- muse.information@musesystems.com :: https://muse.systems

BEGIN

    UPDATE ms_syst_data.syst_global_network_rules
    SET ordering = ordering + 1
    WHERE ordering = new.ordering AND id != new.id;

    RETURN null;

END;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="trig_a_iu_syst_instance_network_rule_ordering()" returnType="trigger" securityType="INVOKER" type="FUNCTION">
         <comment><![CDATA[Ensures that the ordering of network rules is maintained and that ordering
values are not duplicated.

**Trigger Function Details**:

  * **Supported Timing**: `AFTER`

  * **Supported Operations**: `INSERT`, `UPDATE`]]></comment>
         <definition language="plpgsql"><![CDATA[-- File:        trig_a_iu_syst_instance_network_rule_ordering.eex.sql
-- Location:    musebms/database/components/system/mscmp_syst_authn/ms_syst_data/syst_instance_network_rules/trig_a_iu_syst_instance_network_rule_ordering.eex.sql
-- Project:     Muse Systems Business Management System
--
-- Copyright © Lima Buttgereit Holdings LLC d/b/a Muse Systems
-- This file may include content copyrighted and licensed from third parties.
--
-- See the LICENSE file in the project root for license terms and conditions.
-- See the NOTICE file in the project root for copyright ownership information.
--
-- muse.information@musesystems.com :: https://muse.systems

BEGIN

    UPDATE ms_syst_data.syst_instance_network_rules
    SET ordering = ordering + 1
    WHERE instance_id = new.instance_id AND ordering = new.ordering AND id != new.id;

    RETURN null;

END;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="trig_a_iu_syst_owner_network_rule_ordering()" returnType="trigger" securityType="INVOKER" type="FUNCTION">
         <comment><![CDATA[Ensures that the ordering of network rules is maintained and that ordering
values are not duplicated.

**Trigger Function Details**:

  * **Supported Timing**: `AFTER`

  * **Supported Operations**: `INSERT`, `UPDATE`]]></comment>
         <definition language="plpgsql"><![CDATA[-- File:        trig_a_iu_syst_owner_network_rule_ordering.eex.sql
-- Location:    musebms/database/components/system/mscmp_syst_authn/ms_syst_data/syst_owner_network_rules/trig_a_iu_syst_owner_network_rule_ordering.eex.sql
-- Project:     Muse Systems Business Management System
--
-- Copyright © Lima Buttgereit Holdings LLC d/b/a Muse Systems
-- This file may include content copyrighted and licensed from third parties.
--
-- See the LICENSE file in the project root for license terms and conditions.
-- See the NOTICE file in the project root for copyright ownership information.
--
-- muse.information@musesystems.com :: https://muse.systems

BEGIN

    UPDATE ms_syst_data.syst_owner_network_rules
    SET ordering = ordering + 1
    WHERE owner_id = new.owner_id AND ordering = new.ordering AND id != new.id;

    RETURN null;

END;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="trig_b_d_syst_applications_delete_contexts()" returnType="trigger" securityType="INVOKER" type="FUNCTION">
         <comment><![CDATA[Deletes the Application Contexts prior to deleting the Application record
itself.  This is needed because the trigger preventing datastore context owner
contexts to be deleted must be disabled prior to the delete.

**Trigger Function Details**:

  * **Supported Timing**: `BEFORE`

  * **Supported Operations**: `DELETE`]]></comment>
         <definition language="plpgsql"><![CDATA[-- File:        trig_b_d_syst_applications_delete_contexts.eex.sql
-- Location:    musebms/database/components/system/mscmp_syst_instance/ms_syst_data/syst_applications/trig_b_d_syst_applications_delete_contexts.eex.sql
-- Project:     Muse Systems Business Management System
--
-- Copyright © Lima Buttgereit Holdings LLC d/b/a Muse Systems
-- This file may include content copyrighted and licensed from third parties.
--
-- See the LICENSE file in the project root for license terms and conditions.
-- See the NOTICE file in the project root for copyright ownership information.
--
-- muse.information@musesystems.com  :: https://muse.systems

BEGIN

    ALTER TABLE ms_syst_data.syst_application_contexts
        DISABLE TRIGGER c50_trig_b_d_syst_application_contexts_validate_owner_context;

    DELETE FROM ms_syst_data.syst_application_contexts WHERE application_id = old.id;

    ALTER TABLE ms_syst_data.syst_application_contexts
        ENABLE TRIGGER c50_trig_b_d_syst_application_contexts_validate_owner_context;

    RETURN old;

END;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="trig_b_i_syst_enum_functional_type_validate_new_allowed()" returnType="trigger" securityType="INVOKER" type="FUNCTION">
         <comment><![CDATA[Checks to see if this is the first functional type being added for the
enumeration and, if so, that no syst_enum_items records already exist.

**Trigger Function Details**:

  * **Supported Timing**: `BEFORE`

  * **Supported Operations**: `INSERT`

**General Usage**

Adding a first functional type for an enumeration which already has defined
enumeration items implies that the enumeration items must be assigned a
functional type in the same operation to keep data consistency.  In practice,
this would be difficult since there would almost certainly have to be multiple
functional types available in order to avoid making bogus assignments; it would
be much more difficult to manage such a process as compared to simply
disallowing the scenario.]]></comment>
         <definition language="plpgsql"><![CDATA[-- File:        trig_b_i_syst_enum_functional_type_validate_new_allowed.eex.sql
-- Location:    musebms/database/components/system/mscmp_syst_enums/ms_syst_data/syst_enum_functional_types/trig_b_i_syst_enum_functional_type_validate_new_allowed.eex.sql
-- Project:     Muse Systems Business Management System
--
-- Copyright © Lima Buttgereit Holdings LLC d/b/a Muse Systems
-- This file may include content copyrighted and licensed from third parties.
--
-- See the LICENSE file in the project root for license terms and conditions.
-- See the NOTICE file in the project root for copyright ownership information.
--
-- muse.information@musesystems.com  :: https://muse.systems

BEGIN

    IF
        NOT EXISTS(SELECT TRUE
                    FROM ms_syst_data.syst_enum_functional_types
                    WHERE enum_id = new.enum_id) AND
        EXISTS(
                SELECT TRUE
                FROM ms_syst_data.syst_enum_items
                WHERE enum_id = new.enum_id
            )
    THEN

        RAISE EXCEPTION
            USING
                MESSAGE = 'You cannot add a functional type requirement after enumeration item ' ||
                          'records have already been defined.',
                DETAIL  = ms_syst_priv.get_exception_details(
                             p_proc_schema    => 'ms_syst_data'
                            ,p_proc_name      => 'trig_b_i_syst_enum_functional_type_validate_new_allowed'
                            ,p_param_data     => to_jsonb(new)
                            ,p_context_data   =>
                                jsonb_build_object(
                                     'tg_op',         tg_op
                                    ,'tg_when',       tg_when
                                    ,'tg_schema',     tg_table_schema
                                    ,'tg_table_name', tg_table_name)),
                ERRCODE = 'PM105',
                SCHEMA  = tg_table_schema,
                TABLE   = tg_table_name;

    END IF;

    RETURN new;

END;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="trig_b_i_syst_enum_items_maintain_sort_order()" returnType="trigger" securityType="INVOKER" type="FUNCTION">
         <comment><![CDATA[For INSERTed records with a null sort_order value, this trigger will assign a
default value assuming the new record should be inserted at the end of the sort.

**Trigger Function Details**:

  * **Supported Timing**: `BEFORE`

  * **Supported Operations**: `INSERT`

**General Usage**

If the inserted record was already assigned a sort_order value, the inserted
value is respected.]]></comment>
         <definition language="plpgsql"><![CDATA[-- File:        trig_b_i_syst_enum_items_maintain_sort_order.eex.sql
-- Location:    musebms/database/components/system/mscmp_syst_enums/ms_syst_data/syst_enum_items/trig_b_i_syst_enum_items_maintain_sort_order.eex.sql
-- Project:     Muse Systems Business Management System
--
-- Copyright © Lima Buttgereit Holdings LLC d/b/a Muse Systems
-- This file may include content copyrighted and licensed from third parties.
--
-- See the LICENSE file in the project root for license terms and conditions.
-- See the NOTICE file in the project root for copyright ownership information.
--
-- muse.information@musesystems.com  :: https://muse.systems

BEGIN

    new.sort_order :=
        coalesce(
            new.sort_order,
            ( SELECT max( sort_order ) + 1
              FROM ms_syst_data.syst_enum_items
              WHERE enum_id = new.enum_id ),
            1 );

    RETURN new;

END;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="trig_b_i_syst_identities_validate_uniqueness()" returnType="trigger" securityType="INVOKER" type="FUNCTION">
         <comment><![CDATA[Provides a check that each ms_syst_data.syst_identities.account_identifier
value is unique for each owner's access accounts or unique amongst unowned
access accounts.

**Trigger Function Details**:

  * **Supported Timing**: `BEFORE`

  * **Supported Operations**: `INSERT`]]></comment>
         <definition language="plpgsql"><![CDATA[-- File:        trig_b_i_syst_identities_check_uniqueness.eex.sql
-- Location:    musebms/database/components/system/mscmp_syst_authn/ms_syst_data/syst_identities/trig_b_i_syst_identities_check_uniqueness.eex.sql
-- Project:     Muse Systems Business Management System
--
-- Copyright © Lima Buttgereit Holdings LLC d/b/a Muse Systems
-- This file may include content copyrighted and licensed from third parties.
--
-- See the LICENSE file in the project root for license terms and conditions.
-- See the NOTICE file in the project root for copyright ownership information.
--
-- muse.information@musesystems.com  :: https://muse.systems

BEGIN

    IF
        exists( SELECT
                    TRUE
                FROM ms_syst_data.syst_access_accounts saa_this
                    LEFT JOIN ms_syst_data.syst_access_accounts saa_other
                          ON saa_this.owning_owner_id IS NOT DISTINCT FROM saa_other.owning_owner_id AND
                             saa_this.id IS DISTINCT FROM saa_other.id
                    LEFT JOIN ms_syst_data.syst_identities si_any
                          ON ( si_any.access_account_id = saa_other.id OR
                               si_any.access_account_id = saa_this.id ) AND
                             si_any.identity_type_id = new.identity_type_id
                WHERE
                      saa_this.id = new.access_account_id
                  AND si_any.account_identifier = new.account_identifier
            )
    THEN

        RAISE EXCEPTION
            USING
                MESSAGE = 'The identity already matches that of a different access account '
                          'in the same scope of identity resolution.',
                DETAIL = ms_syst_priv.get_exception_details(
                             p_proc_schema    => 'ms_syst_data'
                            ,p_proc_name      => 'trig_b_i_syst_identities_validate_uniqueness'
                            ,p_param_data     => jsonb_build_object(
                                 'access_account_id', new.access_account_id
                                ,'account_identifier', new.account_identifier
                            )
                            ,p_context_data   =>
                                jsonb_build_object(
                                     'tg_op',         tg_op
                                    ,'tg_when',       tg_when
                                    ,'tg_schema',     tg_table_schema
                                    ,'tg_table_name', tg_table_name)),
                ERRCODE = 'PM101',
                SCHEMA = tg_table_schema,
                TABLE = tg_table_name;

    END IF;

    RETURN NEW;

END;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="trig_b_iu_syst_enum_items_validate_functional_types()" returnType="trigger" securityType="INVOKER" type="FUNCTION">
         <comment><![CDATA[Ensures that if the parent syst_enums record has syst_enum_functional_types
records defined, a syst_enum_items record will reference one of those
functional types.

**Trigger Function Details**:

  * **Supported Timing**: `BEFORE`

  * **Supported Operations**: `INSERT`, `UPDATE`

**General Usage**

Note that this trigger function is intended to be use by
constraint triggers.]]></comment>
         <definition language="plpgsql"><![CDATA[-- File:        trig_b_iu_syst_enum_items_validate_functional_types.eex.sql
-- Location:    musebms/database/components/system/mscmp_syst_enums/ms_syst_data/syst_enum_items/trig_b_iu_syst_enum_items_validate_functional_types.eex.sql
-- Project:     Muse Systems Business Management System
--
-- Copyright © Lima Buttgereit Holdings LLC d/b/a Muse Systems
-- This file may include content copyrighted and licensed from third parties.
--
-- See the LICENSE file in the project root for license terms and conditions.
-- See the NOTICE file in the project root for copyright ownership information.
--
-- muse.information@musesystems.com  :: https://muse.systems

BEGIN

    IF
        EXISTS( SELECT TRUE
                FROM ms_syst_data.syst_enum_functional_types seft
                WHERE   seft.enum_id = new.enum_id) AND
        NOT EXISTS( SELECT TRUE
                    FROM ms_syst_data.syst_enum_functional_types seft
                    WHERE   seft.id = new.functional_type_id
                        AND seft.enum_id = new.enum_id)
    THEN

        RAISE EXCEPTION
            USING
                MESSAGE = 'The enumeration requires a valid functional type to be specified.',
                DETAIL  = ms_syst_priv.get_exception_details(
                             p_proc_schema    => 'ms_syst_data'
                            ,p_proc_name      => 'trig_b_iu_syst_enum_items_validate_functional_types'
                            ,p_param_data     => to_jsonb(new)
                            ,p_context_data   =>
                                jsonb_build_object(
                                     'tg_op',         tg_op
                                    ,'tg_when',       tg_when
                                    ,'tg_schema',     tg_table_schema
                                    ,'tg_table_name', tg_table_name)),
                ERRCODE = 'PM104',
                SCHEMA  = tg_table_schema,
                TABLE   = tg_table_name;

    END IF;

    RETURN new;
END;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="trig_b_iud_syst_application_contexts_validate_owner_context()" returnType="trigger" securityType="INVOKER" type="FUNCTION">
         <comment><![CDATA[Validates database_owner_context values based on the pre-existing state of the database.

**Trigger Function Details**:

  * **Supported Timing**: `BEFORE`

  * **Supported Operations**: `INSERT`, `UPDATE`, `DELETE`]]></comment>
         <definition language="plpgsql"><![CDATA[-- File:        trig_b_iud_syst_application_contexts_validate_owner_context.eex.sql
-- Location:    musebms/database/components/system/mscmp_syst_instance/ms_syst_data/syst_application_contexts/trig_b_iud_syst_application_contexts_validate_owner_context.eex.sql
-- Project:     Muse Systems Business Management System
--
-- Copyright © Lima Buttgereit Holdings LLC d/b/a Muse Systems
-- This file may include content copyrighted and licensed from third parties.
--
-- See the LICENSE file in the project root for license terms and conditions.
-- See the NOTICE file in the project root for copyright ownership information.
--
-- muse.information@musesystems.com  :: https://muse.systems

BEGIN

    IF tg_op = 'DELETE' THEN

        IF old.database_owner_context THEN
            RAISE EXCEPTION
                USING
                    MESSAGE = 'You may not delete the designated database owner ' ||
                              'context for an Application from the database.',
                    DETAIL = ms_syst_priv.get_exception_details(
                                 p_proc_schema    => 'ms_syst_data'
                                ,p_proc_name      => 'trig_b_iud_syst_application_contexts_validate_owner_context'
                                ,p_param_data     => to_jsonb(new)
                                ,p_context_data   =>
                                    jsonb_build_object(
                                         'tg_op',         tg_op
                                        ,'tg_when',       tg_when
                                        ,'tg_schema',     tg_table_schema
                                        ,'tg_table_name', tg_table_name)),
                    ERRCODE = 'PM106',
                    SCHEMA = tg_table_schema,
                    TABLE = tg_table_name;
        END IF;

        RETURN old;

    END IF;

    IF tg_op = 'UPDATE' THEN

        IF
            new.database_owner_context != old.database_owner_context
        THEN
            RAISE EXCEPTION
                USING
                    MESSAGE = 'The database owner context designation may ' ||
                              'only be set on INSERT.',
                    DETAIL = ms_syst_priv.get_exception_details(
                                 p_proc_schema    => 'ms_syst'
                                ,p_proc_name      => 'trig_b_iud_syst_application_contexts_validate_owner_context'
                                ,p_param_data     => to_jsonb(new)
                                ,p_context_data   =>
                                    jsonb_build_object(
                                         'tg_op',         tg_op
                                        ,'tg_when',       tg_when
                                        ,'tg_schema',     tg_table_schema
                                        ,'tg_table_name', tg_table_name)),
                    ERRCODE = 'PM107',
                    SCHEMA = tg_table_schema,
                    TABLE = tg_table_name;
        END IF;

    END IF;

    IF tg_op IN ('INSERT', 'UPDATE') THEN

        -- There may only be one database owner context for any one application.
        IF
            new.database_owner_context AND
            exists( SELECT
                        TRUE
                    FROM ms_syst_data.syst_application_contexts sac
                    WHERE
                          sac.application_id = new.application_id
                      AND sac.id != new.id
                      AND sac.database_owner_context)
        THEN
            RAISE EXCEPTION
                USING
                    MESSAGE = 'Each Application may only have one Application Context ' ||
                              'defined as being the database owner.',
                    DETAIL = ms_syst_priv.get_exception_details(
                                 p_proc_schema    => 'ms_syst'
                                ,p_proc_name      => 'trig_b_iud_syst_application_contexts_validate_owner_context'
                                ,p_param_data     => to_jsonb(new)
                                ,p_context_data   =>
                                    jsonb_build_object(
                                         'tg_op',         tg_op
                                        ,'tg_when',       tg_when
                                        ,'tg_schema',     tg_table_schema
                                        ,'tg_table_name', tg_table_name)),
                    ERRCODE = 'PM101',
                    SCHEMA = tg_table_schema,
                    TABLE = tg_table_name;
        END IF;

        -- Database context owners may not be login contexts nor may they be
        -- started
        IF new.database_owner_context AND (new.login_context OR new.start_context) THEN
            RAISE EXCEPTION
                USING
                    MESSAGE = 'A database owner context may not be a login ' ||
                              'context nor may it be started.',
                    DETAIL = ms_syst_priv.get_exception_details(
                                 p_proc_schema    => 'ms_syst'
                                ,p_proc_name      => 'trig_b_iud_syst_application_contexts_validate_owner_context'
                                ,p_param_data     => to_jsonb(new)
                                ,p_context_data   =>
                                    jsonb_build_object(
                                         'tg_op',         tg_op
                                        ,'tg_when',       tg_when
                                        ,'tg_schema',     tg_table_schema
                                        ,'tg_table_name', tg_table_name)),
                    ERRCODE = 'PM107',
                    SCHEMA = tg_table_schema,
                    TABLE = tg_table_name;
        END IF;

        RETURN new;

    END IF;

END;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
   </routines>
</database>
