Newer
Older
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
custom_d4 timestamp without time zone,
custom_t5 character varying(255) DEFAULT NULL::character varying,
custom_n5 bigint,
custom_f5 numeric,
custom_d5 timestamp without time zone,
custom_t6 character varying(255) DEFAULT NULL::character varying,
custom_d6 timestamp without time zone,
custom_t7 character varying(255) DEFAULT NULL::character varying,
custom_d7 timestamp without time zone,
custom_t8 character varying(255) DEFAULT NULL::character varying,
custom_d8 timestamp without time zone,
custom_t9 character varying(255) DEFAULT NULL::character varying,
custom_d9 timestamp without time zone,
custom_t10 character varying(255) DEFAULT NULL::character varying,
custom_d10 timestamp without time zone,
custom_t11 character varying(255) DEFAULT NULL::character varying,
custom_t12 character varying(255) DEFAULT NULL::character varying,
custom_t13 character varying(255) DEFAULT NULL::character varying,
custom_t14 character varying(255) DEFAULT NULL::character varying,
custom_t15 character varying(255) DEFAULT NULL::character varying,
tablename character varying(32) DEFAULT 'res_version_attachments'::character varying,
initiator character varying(50) DEFAULT NULL::character varying,
dest_user character varying(128) DEFAULT NULL::character varying,
video_batch integer,
video_time integer,
video_user character varying(128) DEFAULT NULL::character varying,
video_date timestamp without time zone,
cycle_date timestamp without time zone,
coll_id character varying(32) NOT NULL,
attachment_type character varying(255) DEFAULT NULL::character varying,
dest_contact_id bigint,
dest_address_id bigint,
updated_by character varying(128) DEFAULT NULL::character varying,
is_multicontacts character(1),
res_id_master bigint,
attachment_id_master bigint,
CONSTRAINT res_version_attachments_pkey PRIMARY KEY (res_id)
)
WITH (
OIDS=FALSE
);
-- view for attachments
DROP VIEW IF EXISTS res_view_attachments;
CREATE VIEW res_view_attachments AS
SELECT '0' as res_id, res_id as res_id_version, title, subject, description, publisher, contributor, type_id, format, typist,
creation_date, fulltext_result, ocr_result, author, author_name, identifier, source,
doc_language, relation, coverage, doc_date, docserver_id, folders_system_id, arbox_id, path,
filename, offset_doc, logical_adr, fingerprint, filesize, is_paper, page_count,
scan_date, scan_user, scan_location, scan_wkstation, scan_batch, burn_batch, scan_postmark,
envelop_id, status, destination, approver, validation_date, effective_date, work_batch, origin, is_ingoing, priority, initiator, dest_user,
coll_id, dest_contact_id, dest_address_id, updated_by, is_multicontacts, is_multi_docservers, res_id_master, attachment_type, attachment_id_master
FROM res_version_attachments
UNION ALL
SELECT res_id, '0' as res_id_version, title, subject, description, publisher, contributor, type_id, format, typist,
creation_date, fulltext_result, ocr_result, author, author_name, identifier, source,
doc_language, relation, coverage, doc_date, docserver_id, folders_system_id, arbox_id, path,
filename, offset_doc, logical_adr, fingerprint, filesize, is_paper, page_count,
scan_date, scan_user, scan_location, scan_wkstation, scan_batch, burn_batch, scan_postmark,
envelop_id, status, destination, approver, validation_date, effective_date, work_batch, origin, is_ingoing, priority, initiator, dest_user,
coll_id, dest_contact_id, dest_address_id, updated_by, is_multicontacts, is_multi_docservers, res_id_master, attachment_type, '0'
CREATE SEQUENCE thesaurus_id_seq
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
CREATE TABLE thesaurus
(
thesaurus_id bigint NOT NULL DEFAULT nextval('thesaurus_id_seq'::regclass),
thesaurus_name character varying(255) NOT NULL,
thesaurus_description text,
thesaurus_name_associate character varying(255),
thesaurus_parent_id character varying(255),
creation_date timestamp without time zone,
CONSTRAINT thesaurus_pkey PRIMARY KEY (thesaurus_id)
)
WITH (
OIDS=FALSE
);
CREATE TABLE thesaurus_res
(
res_id bigint NOT NULL,
thesaurus_id bigint NOT NULL
)
WITH (
OIDS=FALSE
CREATE FUNCTION order_alphanum(text) RETURNS text AS $$
SELECT regexp_replace(regexp_replace(regexp_replace(regexp_replace($1,
E'(^|\\D)(\\d{1,3}($|\\D))', E'\\1000\\2', 'g'),
E'(^|\\D)(\\d{4,6}($|\\D))', E'\\1000\\2', 'g'),
E'(^|\\D)(\\d{7}($|\\D))', E'\\100\\2', 'g'),
E'(^|\\D)(\\d{8}($|\\D))', E'\\10\\2', 'g');
$$ LANGUAGE SQL;
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
CREATE TABLE seda
(
"message_id" text NOT NULL,
"schema" text,
"type" text NOT NULL,
"status" text NOT NULL,
"date" timestamp NOT NULL,
"reference" text NOT NULL,
"account_id" text,
"sender_org_identifier" text NOT NULL,
"sender_org_name" text,
"recipient_org_identifier" text NOT NULL,
"recipient_org_name" text,
"archival_agreement_reference" text,
"reply_code" text,
"operation_date" timestamp,
"reception_date" timestamp,
"related_reference" text,
"request_reference" text,
"reply_reference" text,
"derogation" boolean,
"data_object_count" integer,
"size" numeric,
"data" text,
"active" boolean,
"archived" boolean,
PRIMARY KEY ("message_id")
)
WITH (
OIDS=FALSE
);
CREATE TABLE unit_identifier
(
"message_id" text NOT NULL,
"tablename" text NOT NULL,
"res_id" text NOT NULL
);