检查 Postgres, Db2 语句以获取包含定制角色,关系,属性和其他属性的表。
主题区域 | 表名 | 描述 |
---|---|---|
定制 | category_custom_roles | 定制类别角色。 |
定制 | glossary_custom_relationship_def | 定制关系定义。 |
定制 | glossary_ca_attr_artifact_type_assoc | 定制属性定义支持的工件类型。 |
定制 | glossary_custom_relationship_nodes | 定制关系定义的源工件类型和目标工件类型。 |
定制 | glossary_custom_attr_def | 定制属性定义。 |
定制 | glossary_ca_enum_list | ENUM 类型的定制属性定义。 |
定制 | 管理 artifact_custom_attr_values | 定制属性值。 |
定制 | asset_custom_properties | 分配给资产类型的定制属性组以及该组下的属性。 |
定制 | asset_type_custom_properties | 定制属性及其关联的定制组的类型。 |
定制 | asset_prop_enum_list | 类型为 enumeration 的定制属性。 |
定制 | asset_custom_prop_values | 分配给针对资产定义的定制属性的值。 |
category_custom_roles 表
此表包含有关定制类别角色的信息。
此表具有以下列:
role_id
-类别定制角色的标识。role_name
-类别定制角色的名称。
Postgres
CREATE TABLE 语句:
create table category_custom_roles(role_id varchar(32) not null,
role_name varchar(128) not null,
primary key(role_id))
Db2
CREATE TABLE 语句:
create table category_custom_roles(role_id varchar(32) not null,
role_name varchar(128) not null,
primary key(role_id)) ORGANIZE by row
glossary_custom_relationship_def 表
此表包含有关定制关系定义的信息。
此表具有以下列:
cr_definition_id
-定制关系定义的标识。artifact_id
-定制关系定义的标识。name
-定制关系定义的名称。created_on
-定制关系定义的创建日期。created_by
-创建定制关系定义的人员。modified_on
-定制关系定义的修改日期。modified_by
-修改定制关系定义的人员。system_id
-在其中创建定制关系定义的系统标识。type
-定制关系定义的类型。reverse_name
-定制关系定义的反向关系名称。description
-定制关系定义的描述。read_only
-指定定制关系定义是否为只读。default_value
-定制关系定义的缺省值。multiple_values
-指定定制关系定义是否可以具有多个值。
Postgres
CREATE TABLE 语句:
create table glossary_custom_relationship_def(cr_definition_id varchar(128) not null,
artifact_id varchar(128) not null,
name varchar(256) not null,
created_on timestamp(6) not null,
created_by varchar(128) not null,
modified_on timestamp(6),
modified_by varchar(128),
system_id varchar(128),
type varchar(128) not null,
reverse_name varchar(256) not null,
description varchar(256),
read_only boolean not null,
default_value text,
multiple_values boolean not null,
tech_start TIMESTAMP(6) not null default CURRENT_TIMESTAMP,
tech_end TIMESTAMP(6) not null default to_timestamp('9999-12-30', 'YYYY-MM-DD'),
ts_id TIMESTAMP(6) not null default CURRENT_TIMESTAMP,
primary key(cr_definition_id))
Db2
CREATE TABLE 语句:
create table glossary_custom_relationship_def(cr_definition_id varchar(128) not null,
artifact_id varchar(128) not null,
name varchar(256) not null,
created_on timestamp(12) not null,
created_by varchar(128) not null,
modified_on timestamp(12),
modified_by varchar(128),
system_id varchar(128),
type varchar(128) not null,
reverse_name varchar(256) not null,
description varchar(256),
read_only boolean not null,
default_value clob(128),
multiple_values boolean not null,
tech_start TIMESTAMP(12) not null IMPLICITLY HIDDEN generated always as row begin,
tech_end TIMESTAMP(12) not null IMPLICITLY HIDDEN generated always as row
end,
ts_id TIMESTAMP(12) not null generated always as transaction start ID,
primary key(cr_definition_id),
period SYSTEM_TIME (tech_start,
tech_end) ) ORGANIZE by row
glossary_ca_attr_artifact_type_assoc 表
此表包含有关定制属性定义的受支持工件类型的信息。
此表具有以下列:
ca_definition_id
-定制属性定义的标识。artifact_type
-定制关系定义适用的工件类型。
Postgres
CREATE TABLE 语句:
create table glossary_ca_attr_artifact_type_assoc(ca_definition_id varchar(128) not null,
artifact_type varchar(256) not null,
tech_start TIMESTAMP(6) not null default CURRENT_TIMESTAMP,
tech_end TIMESTAMP(6) not null default to_timestamp('9999-12-30', 'YYYY-MM-DD'),
ts_id TIMESTAMP(6) not null default CURRENT_TIMESTAMP,
primary key(ca_definition_id,
artifact_type))
ALTER TABLE 语句:
alter table glossary_ca_attr_artifact_type_assoc add constraint fk_glossary_ca_attr_artifact_type_assoc_glossary_custom_attr_def_1 foreign key (ca_definition_id) references glossary_custom_attr_def(ca_definition_id) on
delete
cascade on
update
no action
Db2
CREATE TABLE 语句:
create table glossary_ca_attr_artifact_type_assoc(ca_definition_id varchar(128) not null,
artifact_type varchar(256) not null,
tech_start TIMESTAMP(12) not null IMPLICITLY HIDDEN generated always as row begin,
tech_end TIMESTAMP(12) not null IMPLICITLY HIDDEN generated always as row
end,
ts_id TIMESTAMP(12) not null generated always as transaction start ID,
primary key(ca_definition_id,
artifact_type),
period SYSTEM_TIME (tech_start,
tech_end) ) ORGANIZE by row
ALTER TABLE 语句:
ALTER TABLE "BITNT2DBSAVIKASH1".glossary_ca_attr_artifact_type_assoc ADD CONSTRAINT fk_glossary_ca_attr_artifact_type_assoc_glossary_custom_attr_def_1 FOREIGN KEY (ca_definition_id) REFERENCES "BITNT2DBSAVIKASH1".glossary_custom_attr_def(ca_definition_id) ON DELETE CASCADE ON UPDATE NO ACTION
glossary_custom_relationship_nodes 表
此表包含有关定制关系定义的源工件类型和目标工件类型的信息。
此表具有以下列:
cr_definition_id
-定制关系定义的标识。end1_artifact_type
-定制关系的源工件类型。end2_artifact_type
-定制关系的目标工件类型。
Postgres
CREATE TABLE 语句:
create table glossary_custom_relationship_nodes(cr_definition_id varchar(128) not null,
end1_artifact_type varchar(128) not null,
end2_artifact_type varchar(128) not null,
tech_start TIMESTAMP(6) not null default CURRENT_TIMESTAMP,
tech_end TIMESTAMP(6) not null default to_timestamp('9999-12-30', 'YYYY-MM-DD'),
ts_id TIMESTAMP(6) not null default CURRENT_TIMESTAMP,
primary key(cr_definition_id,
end1_artifact_type,
end2_artifact_type))
ALTER TABLE 语句
alter table glossary_custom_relationship_nodes add constraint fk_glossary_custom_relationship_nodes_glossary_custom_relationship_def_3 foreign key (cr_definition_id) references glossary_custom_relationship_def(cr_definition_id) on
delete
cascade on
update
no action
Db2
CREATE TABLE 语句:
create table glossary_custom_relationship_nodes(cr_definition_id varchar(128) not null,
end1_artifact_type varchar(128) not null,
end2_artifact_type varchar(128) not null,
tech_start TIMESTAMP(12) not null IMPLICITLY HIDDEN generated always as row begin,
tech_end TIMESTAMP(12) not null IMPLICITLY HIDDEN generated always as row
end,
ts_id TIMESTAMP(12) not null generated always as transaction start ID,
primary key(cr_definition_id,
end1_artifact_type,
end2_artifact_type),
period SYSTEM_TIME (tech_start,
tech_end) ) ORGANIZE by row
ALTER TABLE 语句
alter table glossary_custom_relationship_nodes add constraint fk_glossary_custom_relationship_nodes_glossary_custom_relationship_def_3 foreign key (cr_definition_id) references glossary_custom_relationship_def(cr_definition_id) on
delete
cascade on
update
no action
glossary_custom_attr_def 表
此表包含有关定制属性定义的信息。
此表具有以下列:
ca_definition_id
-定制属性定义的标识。global_id
-定制属性定义的全局标识。name
-定制属性定义的名称。created_on
-定制属性定义的创建日期。created_by
-创建定制属性定义的人员。modified_on
-定制属性定义的修改日期。modified_by
-修改定制属性定义的人员。system_id
-在其中创建定制属性定义的系统标识。type
-定制属性定义的类型。read_only
-指定定制属性定义是否为只读。default_value
-定制属性定义的缺省值。multiple_values
-指定定制属性定义是否可以具有多个值。
Postgres
CREATE TABLE 语句:
create table glossary_custom_attr_def(ca_definition_id varchar(128) not null,
global_id varchar(256) not null,
name varchar(256) not null,
created_on timestamp(6) not null,
created_by varchar(128) not null,
modified_on timestamp(6),
modified_by varchar(128),
system_id varchar(128),
type varchar(128) not null,
read_only boolean not null,
default_value text,
multiple_values boolean not null,
tech_start TIMESTAMP(6) not null default CURRENT_TIMESTAMP,
tech_end TIMESTAMP(6) not null default to_timestamp('9999-12-30', 'YYYY-MM-DD'),
ts_id TIMESTAMP(6) not null default CURRENT_TIMESTAMP,
primary key(ca_definition_id))
Db2
CREATE TABLE 语句:
create table glossary_custom_attr_def(ca_definition_id varchar(128) not null,
global_id varchar(256) not null,
name varchar(256) not null,
created_on timestamp(12) not null,
created_by varchar(128) not null,
modified_on timestamp(12),
modified_by varchar(128),
system_id varchar(128),
type varchar(128) not null,
read_only boolean not null,
default_value clob,
multiple_values boolean not null,
tech_start TIMESTAMP(12) not null IMPLICITLY HIDDEN generated always as row begin,
tech_end TIMESTAMP(12) not null IMPLICITLY HIDDEN generated always as row
end,
ts_id TIMESTAMP(12) not null generated always as transaction start ID,
primary key(ca_definition_id),
period SYSTEM_TIME (tech_start,
tech_end) ) ORGANIZE by row
glossary_ca_enum_list 表
此表包含有关 ENUM 类型的定制属性定义的信息。
此表具有以下列:
ca_definition_id
-枚举类型的定制属性定义的标识。value
-枚举类型的定制属性定义的值。description
-定制属性定义的描述。
Postgres
CREATE TABLE 语句:
create table glossary_ca_enum_list(ca_definition_id varchar(128) not null,
value varchar(128) not null,
description varchar(256),
tech_start TIMESTAMP(6) not null default CURRENT_TIMESTAMP,
tech_end TIMESTAMP(6) not null default to_timestamp('9999-12-30', 'YYYY-MM-DD'),
ts_id TIMESTAMP(6) not null default CURRENT_TIMESTAMP,
primary key(ca_definition_id,
value))
ALTER TABLE 语句:
alter table "BITNT2DBSAVIKASH1".glossary_ca_enum_list add constraint fk_glossary_ca_enum_list_glossary_custom_attr_def_2 foreign key (ca_definition_id) references "BITNT2DBSAVIKASH1".glossary_custom_attr_def(ca_definition_id) on
delete
cascade on
update
no action
Db2
CREATE TABLE 语句:
create table glossary_ca_enum_list(ca_definition_id varchar(128) not null,
value varchar(128) not null,
description varchar(256),
tech_start TIMESTAMP(12) not null IMPLICITLY HIDDEN generated always as row begin,
tech_end TIMESTAMP(12) not null IMPLICITLY HIDDEN generated always as row
end,
ts_id TIMESTAMP(12) not null generated always as transaction start ID,
primary key(ca_definition_id,
value),
period SYSTEM_TIME (tech_start,
tech_end) ) ORGANIZE by row
ALTER TABLE 语句:
alter table glossary_ca_enum_list add constraint fk_glossary_ca_enum_list_glossary_custom_attr_def_2 foreign key (ca_definition_id) references glossary_custom_attr_def(ca_definition_id) on
delete
cascade on
update
no action
管理的 artifact_custom_attr_values 表
此表包含有关定制属性值的信息。
此表具有以下列:
artifact_id
-定制关系定义的标识。ca_definition_id
-定制属性定义的标识。value_id
-定制属性值的标识。text_value
-定制属性的文本值。num_value
-定制属性的数字值。date_value
-定制属性的日期值。value_type
- 自定义属性值的类型。
Postgres
CREATE TABLE 语句:
CREATE TABLE governance_artifact_custom_attr_values(
artifact_id varchar(128) NOT NULL,ca_definition_id varchar(128) NOT NULL,
value_id varchar(128) NOT NULL,text_value text,num_value double precision,
date_value timestamp(6),value_type varchar(16),
tech_start TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
tech_end TIMESTAMP(6) NOT NULL DEFAULT to_timestamp('9999-12-30','YYYY-MM-DD'),
ts_id TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY(artifact_id,ca_definition_id,value_id))
ALTER TABLE 语句:
alter table governance_artifact_custom_attr_values add constraint fk_governance_artifact_custom_attr_values_glossary_custom_attr_def_12 foreign key (ca_definition_id) references glossary_custom_attr_def(ca_definition_id) on
delete
cascade on
update
no action
Db2
CREATE TABLE 语句:
CREATE TABLE governance_artifact_custom_attr_values(
artifact_id varchar(128) NOT NULL,ca_definition_id
varchar(128) NOT NULL,value_id varchar(128) NOT NULL,
text_value text,num_value double precision,
date_value timestamp(6),value_type varchar(16),
tech_start TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
tech_end TIMESTAMP(6) NOT NULL DEFAULT to_timestamp('9999-12-30','YYYY-MM-DD'),
ts_id TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY(artifact_id,ca_definition_id,value_id))
ALTER TABLE 语句:
alter table governance_artifact_custom_attr_values add constraint fk_governance_artifact_custom_attr_values_glossary_custom_attr_def_12 foreign key (ca_definition_id) references glossary_custom_attr_def(ca_definition_id) on
delete
cascade on
update
no action
asset_custom_properties 表
此表具有以下列:
property_id
-定制属性的标识。group_id
-在其下定义了属性的组类型的标识。property_type
-定义定制属性的类型。property_is_array
-定义属性是否具有多个值。property_name
-` 资产定制属性名称。description
-资产定制属性的描述。property_group_name
-资产定制属性的组名。is_column_property
-标识已设置的列属性。
Postgres
CREATE TABLE 语句:
CREATE TABLE asset_custom_properties (
property_id varchar(256) NOT NULL,
property_group_id varchar(256) NOT NULL,
property_type varchar(128) NOT NULL,
property_name varchar(256) NOT NULL,
property_group_name varchar(256) NOT NULL,
property_is_array numeric(1) NOT NULL,
description varchar(256) NULL,
is_column_property numeric(1) NULL,
tech_start timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
tech_end timestamp(6) NOT NULL DEFAULT to_timestamp('9999-12-30'::text, 'YYYY-MM-DD'::text),
ts_id timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT asset_custom_properties_is_column_property_check CHECK ((is_column_property = ANY (ARRAY[(0)::numeric, (1)::numeric]))),
CONSTRAINT asset_custom_properties_pkey PRIMARY KEY (property_id, property_group_id),
CONSTRAINT asset_custom_properties_property_is_array_check CHECK ((property_is_array = ANY (ARRAY[(0)::numeric, (1)::numeric])))
);
ALTER TABLE 语句:
ALTER TABLE IF EXISTS asset_custom_properties
OWNER to postgres;
Db2
CREATE TABLE 语句:
CREATE TABLE asset_custom_properties(property_id varchar(256) NOT NULL,
property_group_id varchar(256) NOT NULL,
property_type varchar(128) NOT NULL,
property_name varchar(256) NOT NULL,
property_group_name varchar(256) NOT NULL,
property_is_array decimal(1) CHECK (property_is_array IN (0, 1)) NOT NULL,
description varchar(256),
is_column_property decimal(1) CHECK (is_column_property IN (0, 1)), tech_start TIMESTAMP(12) NOT NULL IMPLICITLY HIDDEN GENERATED ALWAYS AS ROW
BEGIN
,
tech_end TIMESTAMP(12) NOT NULL IMPLICITLY HIDDEN GENERATED ALWAYS AS ROW
END,
ts_id TIMESTAMP(12) NOT NULL GENERATED ALWAYS AS TRANSACTION START ID,
PRIMARY KEY(property_id,
property_group_id),
PERIOD SYSTEM_TIME (tech_start,
tech_end) )
ALTER TABLE 语句:
ALTER TABLE IF EXISTS asset_custom_properties
OWNER to postgres;
asset_type_custom_properties 表
此表具有以下列:
property_id
-定制属性的标识。group_id
-下面定义了属性的组类型的标识。asset_type
-为其定义定制属性的资产的类型。
Postgres
CREATE TABLE 语句:
CREATE TABLE IF NOT EXISTS asset_type_custom_properties (
property_id character varying(256) COLLATE pg_catalog.default NOT NULL,
property_group_id character varying(256) COLLATE pg_catalog.default NOT NULL,
asset_type character varying(128) COLLATE pg_catalog.default NOT NULL,
tech_start timestamp(6) without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
tech_end timestamp(6) without time zone NOT NULL DEFAULT to_timestamp('9999-12-30' :: text, 'YYYY-MM-DD' :: text),
ts_id timestamp(6) without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT asset_type_custom_properties_pkey PRIMARY KEY (property_id, property_group_id, asset_type),
CONSTRAINT fk_asset_type_custom_properties_asset_custom_properties_1 FOREIGN KEY (property_id, property_group_id) REFERENCES asset_custom_properties (property_id, property_group_id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE CASCADE
)
ALTER TABLE 语句:
ALTER TABLE IF EXISTS asset_type_custom_properties
OWNER to postgres;
Db2
CREATE TABLE 语句:
CREATE TABLE ASSET_TYPE_CUSTOM_PROPERTIES (
PROPERTY_ID VARCHAR(256 OCTETS) NOT NULL,
PROPERTY_GROUP_ID VARCHAR(256 OCTETS) NOT NULL,
ASSET_TYPE VARCHAR(128 OCTETS) NOT NULL,
TECH_START TIMESTAMP(12) NOT NULL IMPLICITLY HIDDEN GENERATED ALWAYS AS ROW BEGIN,
TECH_END TIMESTAMP(12) NOT NULL IMPLICITLY HIDDEN GENERATED ALWAYS AS ROW END,
TS_ID TIMESTAMP(12) NOT NULL GENERATED ALWAYS AS TRANSACTION START ID,
PERIOD SYSTEM_TIME (TECH_START, TECH_END)
) IN USERSPACE1 ORGANIZE BY ROW;
ALTER TABLE 语句:
ALTER TABLE
ASSET_TYPE_CUSTOM_PROPERTIES
ADD
PRIMARY KEY (
PROPERTY_ID,
PROPERTY_GROUP_ID,
ASSET_TYPE
) ENFORCED;
ALTER TABLE
ASSET_TYPE_CUSTOM_PROPERTIES
ADD
CONSTRAINT FK_ASSET_TYPE_CUSTOM_PROPERTIES_ASSET_CUSTOM_PROPERTIES_1 FOREIGN KEY (PROPERTY_ID, PROPERTY_GROUP_ID) REFERENCES ASSET_CUSTOM_PROPERTIES (PROPERTY_ID, PROPERTY_GROUP_ID) ON DELETE CASCADE ON UPDATE NO ACTION ENFORCED ENABLE QUERY OPTIMIZATION;
asset_prop_enum_list 表
类型为 enumeration
的定制属性。
此表具有以下列:
property_id
-定制属性的标识。group_id
-下面定义了属性的组类型的标识。value
-分配给定制属性的值。description
-enum
属性的描述。
Postgres
CREATE TABLE 语句:
CREATE TABLE IF NOT EXISTS asset_prop_enum_list (
property_id character varying(128) COLLATE pg_catalog.default NOT NULL,
property_group_id character varying(256) COLLATE pg_catalog.default NOT NULL,
value character varying(128) COLLATE pg_catalog.default NOT NULL,
description character varying(256) COLLATE pg_catalog.default,
tech_start timestamp(6) without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
tech_end timestamp(6) without time zone NOT NULL DEFAULT to_timestamp('9999-12-30' :: text, 'YYYY-MM-DD' :: text),
ts_id timestamp(6) without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT asset_prop_enum_list_pkey PRIMARY KEY (property_id, property_group_id, value),
CONSTRAINT fk_asset_prop_enum_list_asset_custom_properties_2 FOREIGN KEY (property_id, property_group_id) REFERENCES asset_custom_properties (property_id, property_group_id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE CASCADE
)
ALTER TABLE 语句:
ALTER TABLE IF EXISTS asset_prop_enum_list
OWNER to postgres;
Db2
CREATE TABLE 语句:
CREATE TABLE ASSET_PROP_ENUM_LIST (
PROPERTY_ID VARCHAR(128 OCTETS) NOT NULL,
PROPERTY_GROUP_ID VARCHAR(256 OCTETS) NOT NULL,
VALUE VARCHAR(128 OCTETS) NOT NULL,
DESCRIPTION VARCHAR(256 OCTETS),
TECH_START TIMESTAMP(12) NOT NULL IMPLICITLY HIDDEN GENERATED ALWAYS AS ROW BEGIN,
TECH_END TIMESTAMP(12) NOT NULL IMPLICITLY HIDDEN GENERATED ALWAYS AS ROW END,
TS_ID TIMESTAMP(12) NOT NULL GENERATED ALWAYS AS TRANSACTION START ID,
PERIOD SYSTEM_TIME (TECH_START, TECH_END)
) IN USERSPACE1 ORGANIZE BY ROW;
ALTER TABLE 语句:
ALTER TABLE
ASSET_PROP_ENUM_LIST
ADD
PRIMARY KEY (PROPERTY_ID, PROPERTY_GROUP_ID, VALUE) ENFORCED;
ALTER TABLE
ASSET_PROP_ENUM_LIST
ADD
CONSTRAINT FK_ASSET_PROP_ENUM_LIST_ASSET_CUSTOM_PROPERTIES_2 FOREIGN KEY (PROPERTY_ID, PROPERTY_GROUP_ID) REFERENCES ASSET_CUSTOM_PROPERTIES (PROPERTY_ID, PROPERTY_GROUP_ID) ON DELETE CASCADE ON UPDATE NO ACTION ENFORCED ENABLE QUERY OPTIMIZATION;
asset_custom_prop_values 表
此表具有以下列:
container_id
-指定目录或项目的标识。asset_id
-与定制属性关联的资产的标识。property_id
-定制属性的标识。property_group_id
-在其下方定义了属性的组的标识。asset_type
-定制属性适用于的资产类型。value_id
-给定定制属性的值标识。property_text_value
-text
定制属性的值。property_num_value
-number
定制属性的值。property_date_value
-date
定制属性的值。property_value_type
-值的类型,即字符串,数字,日期,用户和组。
Postgres
CREATE TABLE 语句:
CREATE TABLE asset_custom_prop_values(
container_id varchar(36) NOT NULL,
asset_id varchar(128) NOT NULL,
property_id varchar(256) NOT NULL,
property_group_id varchar(256) NOT NULL,
value_id varchar(256) NOT NULL,
asset_type varchar(256) NOT NULL,
property_text_value text,
property_num_value double precision,
property_date_value timestamp(6),
property_value_type varchar(16),
tech_start TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
tech_end TIMESTAMP(6) NOT NULL DEFAULT to_timestamp('9999-12-30', 'YYYY-MM-DD'),
ts_id TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY(
container_id, asset_id, property_id,
property_group_id, value_id, asset_type
)
)
ALTER TABLE 语句:
ALTER TABLE IF EXISTS asset_custom_prop_values
OWNER to postgres;
Db2
CREATE TABLE 语句:
CREATE TABLE asset_custom_prop_values(
container_id varchar(36) NOT NULL,
asset_id varchar(128) NOT NULL,
property_id varchar(256) NOT NULL,
property_group_id varchar(256) NOT NULL,
value_id varchar(256) NOT NULL,
asset_type varchar(256) NOT NULL,
property_text_value text,
property_num_value double precision,
property_date_value timestamp(6),
property_value_type varchar(16),
tech_start TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
tech_end TIMESTAMP(6) NOT NULL DEFAULT to_timestamp('9999-12-30', 'YYYY-MM-DD'),
ts_id TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY(
container_id, asset_id, property_id,
property_group_id, value_id, asset_type
)
)
ALTER TABLE 语句:
ALTER TABLE
ASSET_CUSTOM_PROP_VALUES
ADD
PRIMARY KEY (
CONTAINER_ID,
ASSET_ID,
PROPERTY_ID,
PROPERTY_GROUP_ID,
VALUE_ID,
ASSET_TYPE
) ENFORCED;
ALTER TABLE
ASSET_CUSTOM_PROP_VALUES
ADD
CONSTRAINT FK_ASSET_CUSTOM_PROP_VALUES_ASSET_TYPE_CUSTOM_PROPERTIES_2 FOREIGN KEY (
PROPERTY_ID,
PROPERTY_GROUP_ID,
ASSET_TYPE
) REFERENCES ASSET_TYPE_CUSTOM_PROPERTIES (
PROPERTY_ID,
PROPERTY_GROUP_ID,
ASSET_TYPE
) ON DELETE CASCADE ON UPDATE NO ACTION ENFORCED ENABLE QUERY OPTIMIZATION;
ALTER TABLE
ASSET_CUSTOM_PROP_VALUES
ADD
CONSTRAINT FK_ASSET_CUSTOM_PROP_VALUES_CONTAINER_ASSETS_1 FOREIGN KEY (CONTAINER_ID, ASSET_ID) REFERENCES CONTAINER_ASSETS (CONTAINER_ID, ASSET_ID) ON DELETE CASCADE ON UPDATE NO ACTION ENFORCED ENABLE QUERY OPTIMIZATION;
了解更多信息
父主题: 报告表