create database docs_easyfore REMOVE THIS AND UPDATE DB NAME;
create EXTENSION "uuid-ossp";
create table binaries
(
	id serial not null
		constraint binaries_pkey
			primary key,
	uuid text default uuid_generate_v4() not null,
	data text,
	mimetype text,
	create_dt timestamp with time zone default now() not null,
	modify_dt timestamp with time zone default now() not null,
	orig_file_name text,
	orig_crm_id integer,
	translation_data text,
	translation_orig_file_name text,
	translation_mimetype text
)
;

create table binaries_archives
(
	id serial not null
		constraint binaries_archives_pkey
			primary key,
	old_id integer,
	uuid text,
	data text,
	mimetype text,
	create_dt timestamp with time zone,
	modify_dt timestamp with time zone,
	orig_file_name text,
	orig_crm_id integer
)
;

create function trg_fx_modify() returns trigger
	language plpgsql
as $$
DECLARE
BEGIN
  new.modify_dt := now();
  INSERT INTO binaries_ARCHIVES(old_id, uuid, data, mimetype, create_dt, modify_dt, orig_file_name, orig_crm_id) VALUES (OLD.id,old.uuid,old.data,old.mimetype,old.create_dt,old.modify_dt,old.orig_file_name,old.orig_crm_id);
  RETURN NEW;
END;
$$
;

faq/support/crm/installation/document_database.txt · Last modified: 2019/04/10 08:50 by 127.0.0.1
Back to top
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0