123 lines
9.8 KiB
XML
123 lines
9.8 KiB
XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
<migration xmlns="http://ebean-orm.github.io/xml/ns/dbmigration">
|
|
<changeSet type="apply">
|
|
<createTable name="audit_log" pkName="pk_audit_log">
|
|
<column name="sys_pk" type="bigint" primaryKey="true"/>
|
|
<column name="tenant_id" type="varchar" notnull="true"/>
|
|
<column name="deleted_on" type="localdatetime"/>
|
|
<column name="deleted_by" type="varchar"/>
|
|
<column name="current_approval_level" type="integer" notnull="true"/>
|
|
<column name="required_approval_levels" type="integer" notnull="true"/>
|
|
<column name="approval_status" type="varchar(8)" notnull="true" checkConstraint="check ( approval_status in ('PENDING','APPROVED','REJECTED'))" checkConstraintName="ck_audit_log_approval_status"/>
|
|
<column name="tags" type="varchar[]" notnull="true"/>
|
|
<column name="comments" type="jsonb" notnull="true"/>
|
|
<column name="audit_type" type="varchar(7)" notnull="true" checkConstraint="check ( audit_type in ('CREATE','UPDATE','DELETE','VIEW','APPROVE','REJECT'))" checkConstraintName="ck_audit_log_audit_type"/>
|
|
<column name="entity" type="varchar" notnull="true"/>
|
|
<column name="unique_identifier" type="varchar" notnull="true"/>
|
|
<column name="data" type="jsonb" notnull="true"/>
|
|
<column name="changes" type="jsonb" notnull="true"/>
|
|
<column name="deleted" type="boolean" defaultValue="false" notnull="true"/>
|
|
<column name="version" type="integer" notnull="true"/>
|
|
<column name="created_at" type="localdatetime" notnull="true"/>
|
|
<column name="modified_at" type="localdatetime" notnull="true"/>
|
|
<column name="created_by" type="varchar" notnull="true"/>
|
|
<column name="modified_by" type="varchar" notnull="true"/>
|
|
</createTable>
|
|
<createTable name="data_model" pkName="pk_data_model">
|
|
<column name="sys_pk" type="bigint" primaryKey="true"/>
|
|
<column name="tenant_id" type="varchar" notnull="true"/>
|
|
<column name="deleted_on" type="localdatetime"/>
|
|
<column name="deleted_by" type="varchar"/>
|
|
<column name="current_approval_level" type="integer" notnull="true"/>
|
|
<column name="required_approval_levels" type="integer" notnull="true"/>
|
|
<column name="approval_status" type="varchar(8)" notnull="true" checkConstraint="check ( approval_status in ('PENDING','APPROVED','REJECTED'))" checkConstraintName="ck_data_model_approval_status"/>
|
|
<column name="tags" type="varchar[]" notnull="true"/>
|
|
<column name="comments" type="jsonb" notnull="true"/>
|
|
<column name="unique_identifier" type="varchar" notnull="true"/>
|
|
<column name="entity_name" type="varchar" notnull="true"/>
|
|
<column name="data" type="jsonb" notnull="true"/>
|
|
<column name="deleted" type="boolean" defaultValue="false" notnull="true"/>
|
|
<column name="version" type="integer" notnull="true"/>
|
|
<column name="created_at" type="localdatetime" notnull="true"/>
|
|
<column name="modified_at" type="localdatetime" notnull="true"/>
|
|
<column name="created_by" type="varchar" notnull="true"/>
|
|
<column name="modified_by" type="varchar" notnull="true"/>
|
|
<uniqueConstraint name="entity_unique_id" columnNames="entity_name,unique_identifier,tenant_id" oneToOne="false" nullableColumns=""/>
|
|
</createTable>
|
|
<createTable name="entity_model" pkName="pk_entity_model">
|
|
<column name="sys_pk" type="bigint" primaryKey="true"/>
|
|
<column name="tenant_id" type="varchar" notnull="true"/>
|
|
<column name="deleted_on" type="localdatetime"/>
|
|
<column name="deleted_by" type="varchar"/>
|
|
<column name="current_approval_level" type="integer" notnull="true"/>
|
|
<column name="required_approval_levels" type="integer" notnull="true"/>
|
|
<column name="approval_status" type="varchar(8)" notnull="true" checkConstraint="check ( approval_status in ('PENDING','APPROVED','REJECTED'))" checkConstraintName="ck_entity_model_approval_status"/>
|
|
<column name="tags" type="varchar[]" notnull="true"/>
|
|
<column name="comments" type="jsonb" notnull="true"/>
|
|
<column name="name" type="varchar" notnull="true"/>
|
|
<column name="pre_save_script" type="varchar" notnull="true"/>
|
|
<column name="post_save_script" type="varchar" notnull="true"/>
|
|
<column name="actions" type="varchar[]" notnull="true"/>
|
|
<column name="allowed_fields" type="varchar[]" notnull="true"/>
|
|
<column name="allowed_field_types" type="jsonb" notnull="true"/>
|
|
<column name="audit_log_fields" type="varchar[]" notnull="true"/>
|
|
<column name="preferences" type="jsonb" notnull="true"/>
|
|
<column name="approval_levels" type="integer" notnull="true"/>
|
|
<column name="deleted" type="boolean" defaultValue="false" notnull="true"/>
|
|
<column name="version" type="integer" notnull="true"/>
|
|
<column name="created_at" type="localdatetime" notnull="true"/>
|
|
<column name="modified_at" type="localdatetime" notnull="true"/>
|
|
<column name="created_by" type="varchar" notnull="true"/>
|
|
<column name="modified_by" type="varchar" notnull="true"/>
|
|
<uniqueConstraint name="uq_entity_model_name" columnNames="name" oneToOne="false" nullableColumns=""/>
|
|
</createTable>
|
|
<createTable name="job_model" pkName="pk_job_model">
|
|
<column name="sys_pk" type="bigint" primaryKey="true"/>
|
|
<column name="tenant_id" type="varchar" notnull="true"/>
|
|
<column name="deleted_on" type="localdatetime"/>
|
|
<column name="deleted_by" type="varchar"/>
|
|
<column name="current_approval_level" type="integer" notnull="true"/>
|
|
<column name="required_approval_levels" type="integer" notnull="true"/>
|
|
<column name="approval_status" type="varchar(8)" notnull="true" checkConstraint="check ( approval_status in ('PENDING','APPROVED','REJECTED'))" checkConstraintName="ck_job_model_approval_status"/>
|
|
<column name="tags" type="varchar[]" notnull="true"/>
|
|
<column name="comments" type="jsonb" notnull="true"/>
|
|
<column name="job_name" type="varchar" notnull="true"/>
|
|
<column name="job_type" type="varchar(6)" notnull="true" checkConstraint="check ( job_type in ('SCRIPT','DB'))" checkConstraintName="ck_job_model_job_type"/>
|
|
<column name="job_path" type="varchar" notnull="true"/>
|
|
<column name="tenants" type="varchar[]" notnull="true"/>
|
|
<column name="job_frequency_type" type="varchar(8)" notnull="true" checkConstraint="check ( job_frequency_type in ('SPECIFIC','EVERY','CRON'))" checkConstraintName="ck_job_model_job_frequency_type"/>
|
|
<column name="frequency" type="varchar" notnull="true"/>
|
|
<column name="deleted" type="boolean" defaultValue="false" notnull="true"/>
|
|
<column name="version" type="integer" notnull="true"/>
|
|
<column name="created_at" type="localdatetime" notnull="true"/>
|
|
<column name="modified_at" type="localdatetime" notnull="true"/>
|
|
<column name="created_by" type="varchar" notnull="true"/>
|
|
<column name="modified_by" type="varchar" notnull="true"/>
|
|
<uniqueConstraint name="uq_job_model_job_name" columnNames="job_name" oneToOne="false" nullableColumns=""/>
|
|
</createTable>
|
|
<createTable name="tenant_model" pkName="pk_tenant_model">
|
|
<column name="sys_pk" type="bigint" primaryKey="true"/>
|
|
<column name="tenant_id" type="varchar" notnull="true"/>
|
|
<column name="deleted_on" type="localdatetime"/>
|
|
<column name="deleted_by" type="varchar"/>
|
|
<column name="current_approval_level" type="integer" notnull="true"/>
|
|
<column name="required_approval_levels" type="integer" notnull="true"/>
|
|
<column name="approval_status" type="varchar(8)" notnull="true" checkConstraint="check ( approval_status in ('PENDING','APPROVED','REJECTED'))" checkConstraintName="ck_tenant_model_approval_status"/>
|
|
<column name="tags" type="varchar[]" notnull="true"/>
|
|
<column name="comments" type="jsonb" notnull="true"/>
|
|
<column name="name" type="varchar" notnull="true"/>
|
|
<column name="domain" type="varchar" notnull="true"/>
|
|
<column name="preferences" type="jsonb" notnull="true"/>
|
|
<column name="deleted" type="boolean" defaultValue="false" notnull="true"/>
|
|
<column name="version" type="integer" notnull="true"/>
|
|
<column name="created_at" type="localdatetime" notnull="true"/>
|
|
<column name="modified_at" type="localdatetime" notnull="true"/>
|
|
<column name="created_by" type="varchar" notnull="true"/>
|
|
<column name="modified_by" type="varchar" notnull="true"/>
|
|
</createTable>
|
|
<createIndex indexName="ix_audit_log_audit_type_entity_unique_identifier_tenant_i_1" tableName="audit_log" columns="audit_type,entity,unique_identifier,tenant_id,created_by"/>
|
|
<createIndex indexName="ix_audit_log_data" tableName="audit_log" columns="data" definition="create index audit_log_values_idx on audit_log using GIN (data) " platforms="POSTGRES"/>
|
|
<createIndex indexName="ix_audit_log_changes" tableName="audit_log" columns="changes" definition="create index audit_log_changes_idx on audit_log using GIN (changes) " platforms="POSTGRES"/>
|
|
<createIndex indexName="ix_data_model_data" tableName="data_model" columns="data" definition="create index data_jsonb_idx on data_model using GIN (data) " platforms="POSTGRES"/>
|
|
</changeSet>
|
|
</migration> |