structure.sql 118 KB
Newer Older
Jean-Louis ERCOLANI's avatar
Jean-Louis ERCOLANI committed
1
-- core/sql/structure/core.postgresql.sql
SNA's avatar
SNA committed
2

3
4
5
6
7
8
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

9
10
--DROP PROCEDURAL LANGUAGE IF EXISTS plpgsql CASCADE;
--CREATE PROCEDURAL LANGUAGE plpgsql;
11
12
13
14
15
16
17
18
19

SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;

CREATE SEQUENCE actions_id_seq
  INCREMENT 1
  MINVALUE 1
  MAXVALUE 9223372036854775807
20
  START 500
21
22
23
24
25
26
27
28
29
  CACHE 1;

CREATE TABLE actions
(
  id integer NOT NULL DEFAULT nextval('actions_id_seq'::regclass),
  keyword character varying(32) NOT NULL DEFAULT ''::bpchar,
  label_action character varying(255),
  id_status character varying(10),
  is_system character(1) NOT NULL DEFAULT 'N'::bpchar,
30
  is_folder_action character(1) NOT NULL DEFAULT 'N'::bpchar,
31
32
33
34
35
  enabled character(1) NOT NULL DEFAULT 'Y'::bpchar,
  action_page character varying(255),
  history character(1) NOT NULL DEFAULT 'N'::bpchar,
  origin character varying(255) NOT NULL DEFAULT 'apps'::bpchar,
  create_id  character(1) NOT NULL DEFAULT 'N'::bpchar,
36
  category_id character varying(255),
37
38
39
40
41
42
43
44
45
46
  CONSTRAINT actions_pkey PRIMARY KEY (id)
)
WITH (OIDS=FALSE);


CREATE TABLE docserver_types
(
  docserver_type_id character varying(32) NOT NULL,
  docserver_type_label character varying(255) DEFAULT NULL::character varying,
  enabled character(1) NOT NULL DEFAULT 'Y'::bpchar,
Giovannoni Laurent's avatar
Giovannoni Laurent committed
47
  is_container character(1) NOT NULL DEFAULT 'N'::bpchar,
48
  container_max_number integer NOT NULL DEFAULT (0)::integer,
Giovannoni Laurent's avatar
Giovannoni Laurent committed
49
  is_compressed character(1) NOT NULL DEFAULT 'N'::bpchar,
50
  compression_mode character varying(32) DEFAULT NULL::character varying,
Giovannoni Laurent's avatar
Giovannoni Laurent committed
51
  is_meta character(1) NOT NULL DEFAULT 'N'::bpchar,
52
  meta_template character varying(32) DEFAULT NULL::character varying,
Giovannoni Laurent's avatar
Giovannoni Laurent committed
53
  is_logged character(1) NOT NULL DEFAULT 'N'::bpchar,
54
  log_template character varying(32) DEFAULT NULL::character varying,
Giovannoni Laurent's avatar
Giovannoni Laurent committed
55
  is_signed character(1) NOT NULL DEFAULT 'N'::bpchar,
56
57
58
59
60
61
62
63
64
65
  fingerprint_mode character varying(32) DEFAULT NULL::character varying,
  CONSTRAINT docserver_types_pkey PRIMARY KEY (docserver_type_id)
)
WITH (OIDS=FALSE);

CREATE TABLE docservers
(
  docserver_id character varying(32) NOT NULL DEFAULT '1'::character varying,
  docserver_type_id character varying(32) NOT NULL,
  device_label character varying(255) DEFAULT NULL::character varying,
Giovannoni Laurent's avatar
Giovannoni Laurent committed
66
  is_readonly character(1) NOT NULL DEFAULT 'N'::bpchar,
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
  enabled character(1) NOT NULL DEFAULT 'Y'::bpchar,
  size_limit_number bigint NOT NULL DEFAULT (0)::bigint,
  actual_size_number bigint NOT NULL DEFAULT (0)::bigint,
  path_template character varying(255) NOT NULL,
  ext_docserver_info character varying(255) DEFAULT NULL::character varying,
  chain_before character varying(32) DEFAULT NULL::character varying,
  chain_after character varying(32) DEFAULT NULL::character varying,
  creation_date timestamp without time zone NOT NULL,
  closing_date timestamp without time zone,
  coll_id character varying(32) NOT NULL DEFAULT 'coll_1'::character varying,
  priority_number integer NOT NULL DEFAULT 10,
  docserver_location_id character varying(32) NOT NULL,
  adr_priority_number integer NOT NULL DEFAULT 1,
  CONSTRAINT docservers_pkey PRIMARY KEY (docserver_id)
)
WITH (OIDS=FALSE);

CREATE TABLE docserver_locations
(
  docserver_location_id character varying(32) NOT NULL,
  ipv4 character varying(255) DEFAULT NULL::character varying,
  ipv6 character varying(255) DEFAULT NULL::character varying,
  net_domain character varying(32) DEFAULT NULL::character varying,
  mask character varying(255) DEFAULT NULL::character varying,
  net_link character varying(255) DEFAULT NULL::character varying,
  enabled character(1) NOT NULL DEFAULT 'Y'::bpchar,
  CONSTRAINT docserver_locations_pkey PRIMARY KEY (docserver_location_id)
)
WITH (OIDS=FALSE);

CREATE SEQUENCE doctypes_type_id_seq
  INCREMENT 1
  MINVALUE 1
  MAXVALUE 9223372036854775807
Giovannoni Laurent's avatar
Giovannoni Laurent committed
101
  START 500
102
103
104
105
106
107
108
109
110
111
112
113
  CACHE 1;

CREATE TABLE doctypes
(
  coll_id character varying(32) NOT NULL DEFAULT ''::character varying,
  type_id integer NOT NULL DEFAULT nextval('doctypes_type_id_seq'::regclass),
  description character varying(255) NOT NULL DEFAULT ''::character varying,
  enabled character(1) NOT NULL DEFAULT 'Y'::bpchar,
  doctypes_first_level_id integer,
  doctypes_second_level_id integer,
  primary_retention  character varying(50) DEFAULT NULL,
  secondary_retention  character varying(50) DEFAULT NULL,
Alexandre Morin's avatar
Alexandre Morin committed
114
115
  retention_final_disposition character varying(255) NOT NULL DEFAULT 'destruction'::character varying,
  retention_rule character varying(15) NOT NULL DEFAULT 'P10Y'::character varying,
116
  duration_current_use integer,
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
  CONSTRAINT doctypes_pkey PRIMARY KEY (type_id)
)
WITH (OIDS=FALSE);

CREATE SEQUENCE history_id_seq
  INCREMENT 1
  MINVALUE 1
  MAXVALUE 9223372036854775807
  START 1
  CACHE 1;

CREATE TABLE history
(
  id bigint NOT NULL DEFAULT nextval('history_id_seq'::regclass),
  table_name character varying(32) DEFAULT NULL::character varying,
  record_id character varying(255) DEFAULT NULL::character varying,
  event_type character varying(32) NOT NULL,
134
  user_id character varying(128) NOT NULL,
135
136
137
138
  event_date timestamp without time zone NOT NULL,
  info text,
  id_module character varying(50) NOT NULL DEFAULT 'admin'::character varying,
  remote_ip character varying(32) DEFAULT NULL,
Giovannoni Laurent's avatar
Giovannoni Laurent committed
139
  event_id character varying(50),
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
  CONSTRAINT history_pkey PRIMARY KEY (id)
)
WITH (OIDS=FALSE);

CREATE SEQUENCE history_batch_id_seq
  INCREMENT 1
  MINVALUE 1
  MAXVALUE 9223372036854775807
  START 1
  CACHE 1;

CREATE TABLE history_batch
(
  id bigint NOT NULL DEFAULT nextval('history_batch_id_seq'::regclass),
  module_name character varying(32) DEFAULT NULL::character varying,
  batch_id bigint DEFAULT NULL::bigint,
  event_date timestamp without time zone NOT NULL,
  total_processed bigint DEFAULT NULL::bigint,
  total_errors bigint DEFAULT NULL::bigint,
  info text,
  CONSTRAINT history_batch_pkey PRIMARY KEY (id)
)
WITH (OIDS=FALSE);

CREATE TABLE parameters
(
166
  id character varying(255) NOT NULL,
Cyril Vazquez's avatar
Cyril Vazquez committed
167
  description TEXT,
168
  param_value_string character varying(255) DEFAULT NULL::character varying,
169
170
171
172
173
174
175
176
177
178
  param_value_int integer,
  param_value_date timestamp without time zone,
  CONSTRAINT parameters_pkey PRIMARY KEY (id)
)
WITH (OIDS=FALSE);

CREATE SEQUENCE security_security_id_seq
  INCREMENT 1
  MINVALUE 1
  MAXVALUE 9223372036854775807
179
  START 600
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
  CACHE 1;

CREATE TABLE "security"
(
  security_id bigint NOT NULL DEFAULT nextval('security_security_id_seq'::regclass),
  group_id character varying(32) NOT NULL,
  coll_id character varying(32) NOT NULL,
  where_clause text,
  maarch_comment text,
  can_insert character(1) NOT NULL DEFAULT 'N'::bpchar,
  can_update character(1) NOT NULL DEFAULT 'N'::bpchar,
  can_delete character(1) NOT NULL DEFAULT 'N'::bpchar,
  rights_bitmask integer NOT NULL DEFAULT 0,
  mr_start_date timestamp without time zone DEFAULT NULL,
  mr_stop_date timestamp without time zone DEFAULT NULL,
  where_target character varying(15) DEFAULT 'DOC'::character varying,
  CONSTRAINT security_pkey PRIMARY KEY (security_id)
)
WITH (OIDS=FALSE);

CREATE TABLE status
(
  id character varying(10) NOT NULL,
  label_status character varying(50) NOT NULL,
  is_system character(1) NOT NULL DEFAULT 'Y'::bpchar,
205
  is_folder_status character(1) NOT NULL default 'N'::bpchar,
206
207
208
209
210
211
212
213
214
215
  img_filename character varying(255),
  maarch_module character varying(255) NOT NULL DEFAULT 'apps'::character varying,
  can_be_searched character(1) NOT NULL DEFAULT 'Y'::bpchar,
  can_be_modified character(1) NOT NULL DEFAULT 'Y'::bpchar,
  CONSTRAINT status_pkey PRIMARY KEY (id)
)
WITH (OIDS=FALSE);

CREATE TABLE usergroup_content
(
216
  user_id character varying(128) NOT NULL,
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
  group_id character varying(32) NOT NULL,
  primary_group character(1) NOT NULL,
  "role" character varying(255) DEFAULT NULL::character varying,
  CONSTRAINT usergroup_content_pkey PRIMARY KEY (user_id, group_id)
)
WITH (OIDS=FALSE);

CREATE TABLE usergroups
(
  group_id character varying(32) NOT NULL,
  group_desc character varying(255) DEFAULT NULL::character varying,
  administrator character(1) NOT NULL DEFAULT 'N'::bpchar,
  custom_right1 character(1) NOT NULL DEFAULT 'N'::bpchar,
  custom_right2 character(1) NOT NULL DEFAULT 'N'::bpchar,
  custom_right3 character(1) NOT NULL DEFAULT 'N'::bpchar,
  custom_right4 character(1) NOT NULL DEFAULT 'N'::bpchar,
  enabled character(1) NOT NULL DEFAULT 'Y'::bpchar,
  CONSTRAINT usergroups_pkey PRIMARY KEY (group_id)
)
WITH (OIDS=FALSE);

CREATE TABLE usergroups_services
(
  group_id character varying NOT NULL,
  service_id character varying NOT NULL,
  CONSTRAINT usergroups_services_pkey PRIMARY KEY (group_id, service_id)
)
WITH (OIDS=FALSE);

CREATE TABLE users
(
248
  user_id character varying(128) NOT NULL,
249
250
251
  "password" character varying(255) DEFAULT NULL::character varying,
  firstname character varying(255) DEFAULT NULL::character varying,
  lastname character varying(255) DEFAULT NULL::character varying,
Giovannoni Laurent's avatar
Giovannoni Laurent committed
252
  phone character varying(32) DEFAULT NULL::character varying,
253
254
255
256
257
258
259
260
261
262
263
264
265
  mail character varying(255) DEFAULT NULL::character varying,
  department character varying(50) DEFAULT NULL::character varying,
  custom_t1 character varying(50) DEFAULT '0'::character varying,
  custom_t2 character varying(50) DEFAULT NULL::character varying,
  custom_t3 character varying(50) DEFAULT NULL::character varying,
  cookie_key character varying(255) DEFAULT NULL::character varying,
  cookie_date timestamp without time zone,
  enabled character(1) NOT NULL DEFAULT 'Y'::bpchar,
  change_password character(1) NOT NULL DEFAULT 'Y'::bpchar,
  delay_number integer DEFAULT NULL,
  status character varying(10) NOT NULL DEFAULT 'OK'::character varying,
  loginmode character varying(50) DEFAULT NULL::character varying,
  docserver_location_id character varying(32) DEFAULT NULL::character varying,
266
  thumbprint text DEFAULT NULL::character varying,
267
268
  signature_path character varying(255) DEFAULT NULL::character varying,
  signature_file_name character varying(255) DEFAULT NULL::character varying,
269
  initials character varying(32) DEFAULT NULL::character varying,
270
271
  ra_code character varying(255) DEFAULT NULL::character varying,
  ra_expiration_date timestamp without time zone,
272
273
274
  CONSTRAINT users_pkey PRIMARY KEY (user_id)
)
WITH (OIDS=FALSE);
275
276


Jean-Louis ERCOLANI's avatar
Jean-Louis ERCOLANI committed
277
-- modules/advanced_physical_archive/sql/structure/advanced_physical_archive.postgresql.sql
278
279
280

 CREATE  TABLE  res_apa (
 res_id serial  NOT  NULL ,
281
 title character varying(255)    default NULL ,
282
283
 subject text ,
 description text ,
284
285
 publisher character varying(255)    default NULL ,
 contributor character varying(255)    default NULL ,
286
 type_id integer  default  NULL ,
287
288
 format character varying(50)   default NULL ,
 typist character varying(128)   default NULL ,
289
 creation_date timestamp without time zone NOT  NULL ,
290
 author character varying(255)    default NULL ,
291
 author_name text ,
292
293
294
 identifier character varying(255)    default NULL ,
 source character varying(255)    default NULL ,
 doc_language character varying(50)    default NULL ,
295
 relation integer  default NULL ,
296
 coverage character varying(255)    default NULL ,
297
 doc_date timestamp without time zone  default NULL ,
298
 docserver_id character varying(32)   default NULL ,
299
 folders_system_id integer  default NULL ,
300
301
302
303
304
305
 arbox_id character varying(32)    default NULL ,
 path character varying(255)    default NULL ,
 filename character varying(255)    default NULL ,
 offset_doc character varying(255)    default NULL ,
 logical_adr character varying(255)    default NULL ,
 fingerprint character varying(255)    default NULL ,
306
 filesize integer  default NULL ,
307
 is_paper char(1)    default NULL ,
308
309
 page_count integer  default NULL ,
 scan_date timestamp without time zone  default NULL ,
310
311
312
313
314
315
 scan_user character varying(50)    default NULL ,
 scan_location character varying(255)    default NULL ,
 scan_wkstation character varying(255)    default NULL ,
 scan_batch character varying(50)    default NULL ,
 burn_batch character varying(50)    default NULL ,
 scan_postmark character varying(50)    default NULL ,
316
 envelop_id integer  default NULL ,
317
318
319
 status character varying(3)    default NULL ,
 destination character varying(50)    default NULL ,
 approver character varying(50)    default NULL ,
320
321
 validation_date timestamp without time zone  default NULL ,
 work_batch integer  default NULL ,
322
323
 origin character varying(50)    default NULL ,
 is_ingoing char(1)    default NULL ,
324
 priority smallint default NULL ,
325
 arbatch_id character varying(32)    default NULL ,
326
327
328
329
330
331
332
 fulltext_result character varying(10)  DEFAULT NULL,
 ocr_result character varying(10)  DEFAULT NULL,
 converter_result  character varying(10)  DEFAULT NULL,
 custom_t1  text default NULL,
 custom_n1 integer  default NULL ,
 custom_f1 numeric  default NULL ,
 custom_d1 timestamp without time zone  default NULL ,
333
 custom_t2 character varying(255)    default NULL ,
334
335
336
 custom_n2 integer  default NULL ,
 custom_f2 numeric  default NULL ,
 custom_d2 timestamp without time zone  default NULL ,
337
 custom_t3 character varying(255)    default NULL ,
338
339
340
 custom_n3 integer  default NULL ,
 custom_f3 numeric  default NULL ,
 custom_d3 timestamp without time zone  default NULL ,
341
 custom_t4 character varying(255)    default NULL ,
342
343
344
 custom_n4 integer  default NULL ,
 custom_f4 numeric  default NULL ,
 custom_d4 timestamp without time zone  default NULL ,
345
 custom_t5 character varying(255)    default NULL ,
346
347
348
 custom_n5 integer  default NULL ,
 custom_f5 numeric  default NULL ,
 custom_d5 timestamp without time zone  default NULL ,
349
 custom_t6 character varying(255)    default NULL ,
350
 custom_d6 timestamp without time zone  default NULL ,
351
 custom_t7 character varying(255)    default NULL ,
352
 custom_d7 timestamp without time zone  default NULL ,
353
 custom_t8 character varying(255)    default NULL ,
354
 custom_d8 timestamp without time zone  default NULL ,
355
 custom_t9 character varying(255)    default NULL ,
356
 custom_d9 timestamp without time zone  default NULL ,
357
 custom_t10 character varying(255)    default NULL ,
358
 custom_d10 timestamp without time zone  default NULL ,
359
360
361
362
363
364
365
366
 custom_t11 character varying(255)    default NULL ,
 custom_t12 character varying(255)    default NULL ,
 custom_t13 character varying(255)    default NULL ,
 custom_t14 character varying(255)    default NULL ,
 custom_t15 character varying(255)    default NULL ,
 tablename character varying(32)   default  'res_apa',
 initiator character varying(50)    default NULL ,
 dest_user character varying(128)    default NULL ,
367
368
 video_batch integer  default NULL ,
 video_time timestamp NULL  default NULL ,
369
 video_user character varying(128)    default NULL ,
370
371
372
373
374
375
 video_date timestamp without time zone,
 CONSTRAINT res_apa_pkey PRIMARY KEY (res_id)
)
WITH (OIDS=FALSE);


Jean-Louis ERCOLANI's avatar
Jean-Louis ERCOLANI committed
376
-- modules/attachments/sql/structure/attachments.postgresql.sql
377

378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395

CREATE SEQUENCE res_attachment_res_id_seq
  INCREMENT 1
  MINVALUE 1
  MAXVALUE 9223372036854775807
  START 1
  CACHE 1;

CREATE TABLE res_attachments
(
  res_id bigint NOT NULL DEFAULT nextval('res_attachment_res_id_seq'::regclass),
  title character varying(255) DEFAULT NULL::character varying,
  subject text,
  description text,
  publisher character varying(255) DEFAULT NULL::character varying,
  contributor character varying(255) DEFAULT NULL::character varying,
  type_id bigint ,
  format character varying(50) NOT NULL,
396
  typist character varying(128) NOT NULL,
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
  creation_date timestamp without time zone NOT NULL,
  fulltext_result character varying(10) DEFAULT NULL::character varying,
  ocr_result character varying(10) DEFAULT NULL::character varying,
  author character varying(255) DEFAULT NULL::character varying,
  author_name text,
  identifier character varying(255) DEFAULT NULL::character varying,
  source character varying(255) DEFAULT NULL::character varying,
  doc_language character varying(50) DEFAULT NULL::character varying,
  relation bigint,
  coverage character varying(255) DEFAULT NULL::character varying,
  doc_date timestamp without time zone,
  docserver_id character varying(32) NOT NULL,
  folders_system_id bigint,
  arbox_id character varying(32) DEFAULT NULL::character varying,
  path character varying(255) DEFAULT NULL::character varying,
  filename character varying(255) DEFAULT NULL::character varying,
  offset_doc character varying(255) DEFAULT NULL::character varying,
  logical_adr character varying(255) DEFAULT NULL::character varying,
  fingerprint character varying(255) DEFAULT NULL::character varying,
  filesize bigint,
  is_paper character(1) DEFAULT NULL::bpchar,
  page_count integer,
  scan_date timestamp without time zone,
  scan_user character varying(50) DEFAULT NULL::character varying,
  scan_location character varying(255) DEFAULT NULL::character varying,
  scan_wkstation character varying(255) DEFAULT NULL::character varying,
  scan_batch character varying(50) DEFAULT NULL::character varying,
  burn_batch character varying(50) DEFAULT NULL::character varying,
  scan_postmark character varying(50) DEFAULT NULL::character varying,
  envelop_id bigint,
  status character varying(10) DEFAULT NULL::character varying,
  destination character varying(50) DEFAULT NULL::character varying,
  approver character varying(50) DEFAULT NULL::character varying,
  validation_date timestamp without time zone,
431
  effective_date timestamp without time zone,
432
433
434
435
436
  work_batch bigint,
  origin character varying(50) DEFAULT NULL::character varying,
  is_ingoing character(1) DEFAULT NULL::bpchar,
  priority smallint,
  initiator character varying(50) DEFAULT NULL::character varying,
437
  dest_user character varying(128) DEFAULT NULL::character varying,
438
439
  coll_id character varying(32) NOT NULL,
  res_id_master bigint,
440
441
442
443
444
445
  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),
  is_multi_docservers character(1) NOT NULL DEFAULT 'N'::bpchar,
Couture's avatar
Couture committed
446
447
  tnl_path character varying(255) DEFAULT NULL::character varying,
  tnl_filename character varying(255) DEFAULT NULL::character varying,
448
449
450
  CONSTRAINT res_attachments_pkey PRIMARY KEY (res_id)
)
WITH (OIDS=FALSE);
451
452


Jean-Louis ERCOLANI's avatar
Jean-Louis ERCOLANI committed
453
-- modules/autofoldering/sql/structure/autofoldering.postgresql.sql
454

455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475

CREATE TABLE af_security
(
  af_security_id bigint NOT NULL,
  af_security_label character varying(255) NOT NULL,
  group_id character varying(50) NOT NULL,
  tree_id character varying(50) NOT NULL,
  where_clause text NOT NULL,
  start_date timestamp without time zone,
  stop_date timestamp without time zone,
  CONSTRAINT af_security_pkey PRIMARY KEY (af_security_id)
)
WITH (OIDS=FALSE);

-- Filled during autofoldering load
-- If you create your on table for a new tree
-- It is very important to respect the order of fields : DO NOT PUT IDS IN THE END OF THE TABLE!!!
CREATE TABLE af_view_year_target
(
  level1 character varying(255) NOT NULL , -- Pays / Country : custom_t3
  level1_id integer NOT NULL,
476
  level2 character(4) ,          -- Année / Year : date_part('year', doc_date)
477
478
479
480
481
482
483
484
485
486
487
488
489
  level2_id integer NOT NULL,
  level3 character varying(255) ,          -- Client / Customer : custom_t4
  level3_id integer NOT NULL,
  CONSTRAINT af_view_year_target_pkey PRIMARY KEY (level1, level2, level3)
)
WITH (OIDS=FALSE);

CREATE TABLE af_view_customer_target
(
  level1 character varying(255) NOT NULL , -- 1ère lettre client / Customer 1st letter : substring(custom_t4, 1, 1)
  level1_id integer NOT NULL,
  level2 character varying(255) ,          -- Client / Customer : custom_t4
  level2_id integer NOT NULL,
490
  level3 character(4) ,                    -- Année / Year : date_part('year', doc_date)
491
492
493
494
  level3_id integer NOT NULL,
  CONSTRAINT af_view_customer_target_pkey PRIMARY KEY (level1, level2, level3)
)
WITH (OIDS=FALSE);
SNA's avatar
SNA committed
495

496

Jean-Louis ERCOLANI's avatar
Jean-Louis ERCOLANI committed
497
-- modules/basket/sql/structure/basket.postgresql.sql
498

499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
CREATE TABLE actions_groupbaskets
(
  id_action bigint NOT NULL,
  where_clause text,
  group_id character varying(32) NOT NULL,
  basket_id character varying(32) NOT NULL,
  used_in_basketlist character(1) NOT NULL DEFAULT 'Y'::bpchar,
  used_in_action_page character(1) NOT NULL DEFAULT 'Y'::bpchar,
  default_action_list character(1) NOT NULL DEFAULT 'N'::bpchar,
  CONSTRAINT actions_groupbaskets_pkey PRIMARY KEY (id_action, group_id, basket_id)
)
WITH (OIDS=FALSE);

CREATE TABLE baskets
(
  coll_id character varying(32) NOT NULL,
  basket_id character varying(32) NOT NULL,
  basket_name character varying(255) NOT NULL,
  basket_desc character varying(255) NOT NULL,
  basket_clause text NOT NULL,
  is_generic character varying(6) NOT NULL DEFAULT 'N'::character varying,
520
  is_visible character(1) NOT NULL DEFAULT 'Y'::bpchar,
521
  is_folder_basket character (1) NOT NULL default 'N'::bpchar,
522
  enabled character(1) NOT NULL DEFAULT 'Y'::bpchar,
Florian Azizian's avatar
Florian Azizian committed
523
  basket_order integer,
Giovannoni Laurent's avatar
Giovannoni Laurent committed
524
  basket_res_order character varying(255),
525
  flag_notif character varying(1),
526
  except_notif text,
527
528
529
530
  CONSTRAINT baskets_pkey PRIMARY KEY (coll_id, basket_id)
)
WITH (OIDS=FALSE);

Giovannoni Laurent's avatar
Giovannoni Laurent committed
531
532
533
CREATE TABLE basket_persistent_mode
(
  res_id bigint,
534
  user_id character varying(128),
Giovannoni Laurent's avatar
Giovannoni Laurent committed
535
536
537
538
539
540
  is_persistent character varying(1)
)
WITH (
  OIDS=FALSE
);

541
542
543
544
CREATE TABLE res_mark_as_read
(
  coll_id character varying(32),
  res_id bigint,
545
  user_id character varying(128),
546
547
548
549
550
551
  basket_id character varying(32)
)
WITH (
  OIDS=FALSE
);

552
553
554
555
556
557
558
559
560
561
562
CREATE TABLE groupbasket
(
  group_id character varying(32) NOT NULL,
  basket_id character varying(32) NOT NULL,
  "sequence" integer NOT NULL DEFAULT 0,
  redirect_basketlist character varying(2048) DEFAULT NULL::character varying,
  redirect_grouplist character varying(2048) DEFAULT NULL::character varying,
  result_page character varying(255) DEFAULT 'show_list1.php'::character varying,
  can_redirect character(1) NOT NULL DEFAULT 'N'::bpchar,
  can_delete character(1) NOT NULL DEFAULT 'N'::bpchar,
  can_insert character(1) NOT NULL DEFAULT 'N'::bpchar,
563
564
  list_lock_clause text,
  sublist_lock_clause text,
565
566
567
568
569
570
571
572
573
574
575
576
577
578
  CONSTRAINT groupbasket_pkey PRIMARY KEY (group_id, basket_id)
)
WITH (OIDS=FALSE);

CREATE SEQUENCE user_abs_seq
  INCREMENT 1
  MINVALUE 1
  MAXVALUE 9223372036854775807
  START 1
  CACHE 1;

CREATE TABLE user_abs
(
  system_id bigint NOT NULL DEFAULT nextval('user_abs_seq'::regclass),
579
580
  user_abs character varying(128) NOT NULL,
  new_user character varying(128) NOT NULL,
581
582
583
584
585
586
  basket_id character varying(255) NOT NULL,
  basket_owner character varying(255),
  is_virtual character(1) NOT NULL DEFAULT 'N'::bpchar,
  CONSTRAINT user_abs_pkey PRIMARY KEY (system_id)
)
WITH (OIDS=FALSE);
587
588


Jean-Louis ERCOLANI's avatar
Jean-Louis ERCOLANI committed
589
-- modules/cases/sql/structure/cases.postgresql.sql
590

591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
CREATE SEQUENCE case_id_seq
  INCREMENT 1
  MINVALUE 1
  MAXVALUE 9223372036854775807
  START 1
  CACHE 1;

CREATE TABLE cases
(
  case_id integer NOT NULL DEFAULT nextval('case_id_seq'::regclass),
  case_label character varying(255) NOT NULL DEFAULT ''::bpchar,
  case_description character varying(255),
  case_type character varying(32),
  case_closing_date timestamp without time zone,
  case_last_update_date timestamp without time zone NOT NULL,
  case_creation_date timestamp without time zone NOT NULL,
607
  case_typist character varying(128) NOT NULL DEFAULT ''::bpchar,
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
  case_parent integer,
  case_custom_t1 character varying(255),
  case_custom_t2 character varying(255),
  case_custom_t3 character varying(255),
  case_custom_t4 character varying(255),
  CONSTRAINT cases_pkey PRIMARY KEY (case_id)
);

CREATE TABLE cases_res
(
  case_id integer NOT NULL,
  res_id integer NOT NULL,
  CONSTRAINT cases_res_pkey PRIMARY KEY (case_id,res_id)
);

623
624


Jean-Louis ERCOLANI's avatar
Jean-Louis ERCOLANI committed
625
-- modules/entities/sql/structure/entities.postgresql.sql
626

627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643

CREATE TABLE entities
(
  entity_id character varying(32) NOT NULL,
  entity_label character varying(255),
  short_label character varying(50),
  enabled character(1) NOT NULL DEFAULT 'Y'::bpchar,
  adrs_1 character varying(255),
  adrs_2 character varying(255),
  adrs_3 character varying(255),
  zipcode character varying(32),
  city character varying(255),
  country character varying(255),
  email character varying(255),
  business_id character varying(32),
  parent_entity_id character varying(32),
  entity_type character varying(64),
644
  entity_path character varying(2048),
645
  ldap_id character varying(255),
Alexandre Morin's avatar
Alexandre Morin committed
646
  archival_agency character varying(255),
647
  archival_agreement character varying(255),
648
649
650
651
  CONSTRAINT entities_pkey PRIMARY KEY (entity_id)
)
WITH (OIDS=FALSE);

Cyril Vazquez's avatar
Cyril Vazquez committed
652
653
654
655
656
657
658
659

CREATE SEQUENCE listinstance_id_seq
  INCREMENT 1
  MINVALUE 1
  MAXVALUE 9223372036854775807
  START 1
  CACHE 1;

660
661
CREATE TABLE listinstance
(
Cyril Vazquez's avatar
Cyril Vazquez committed
662
  listinstance_id BIGINT NOT NULL DEFAULT nextval('listinstance_id_seq'::regclass),
663
664
665
666
  coll_id character varying(50) NOT NULL,
  res_id bigint NOT NULL,
  listinstance_type character varying(50) DEFAULT 'DOC'::character varying,
  "sequence" bigint NOT NULL,
667
  item_id character varying(128) NOT NULL,
668
669
  item_type character varying(255) NOT NULL,
  item_mode character varying(50) NOT NULL,
670
  added_by_user character varying(128) NOT NULL,
671
  added_by_entity character varying(50) NOT NULL,
672
  visible character varying(1) NOT NULL DEFAULT 'Y'::bpchar,
Cyril Vazquez's avatar
Cyril Vazquez committed
673
  viewed bigint,
Cyril Vazquez's avatar
Cyril Vazquez committed
674
  difflist_type character varying(50),
675
  process_date timestamp without time zone,
676
  process_comment character varying(255),
Cyril Vazquez's avatar
Cyril Vazquez committed
677
  CONSTRAINT listinstance_pkey PRIMARY KEY (listinstance_id)
678
679
680
681
682
683
684
685
686
)
WITH (OIDS=FALSE);

CREATE TABLE listmodels
(
  coll_id character varying(50) NOT NULL,
  object_id character varying(50) NOT NULL,
  object_type character varying(255) NOT NULL,
  "sequence" bigint NOT NULL,
687
  item_id character varying(128) NOT NULL,
688
689
  item_type character varying(255) NOT NULL,
  item_mode character varying(50) NOT NULL,
Cyril Vazquez's avatar
Cyril Vazquez committed
690
  listmodel_type character varying(50) DEFAULT 'DOC'::character varying,
691
  title character varying(255),
Cyril Vazquez's avatar
Cyril Vazquez committed
692
  description character varying(255),
693
  process_comment character varying(255),
Cyril Vazquez's avatar
Cyril Vazquez committed
694
  visible character varying(1) NOT NULL DEFAULT 'Y'::bpchar
695
696
697
)
WITH (OIDS=FALSE);

698
CREATE TABLE difflist_types 
Cyril Vazquez's avatar
Cyril Vazquez committed
699
(
700
701
702
703
704
705
  difflist_type_id character varying(50) NOT NULL,
  difflist_type_label character varying(100) NOT NULL,
  difflist_type_roles TEXT,
  allow_entities character varying(1) NOT NULL DEFAULT 'N'::bpchar,
  is_system character varying(1) NOT NULL DEFAULT 'N'::bpchar,
  CONSTRAINT "difflist_types_pkey" PRIMARY KEY (difflist_type_id)
Cyril Vazquez's avatar
Cyril Vazquez committed
706
707
708
709
710
)
WITH (
    OIDS=FALSE
);

711
712
CREATE TABLE users_entities
(
713
  user_id character varying(128) NOT NULL,
714
715
716
717
718
719
720
721
722
723
724
  entity_id character varying(32) NOT NULL,
  user_role character varying(255),
  primary_entity character(1) NOT NULL DEFAULT 'N'::bpchar,
  CONSTRAINT users_entities_pkey PRIMARY KEY (user_id, entity_id)
)
WITH (OIDS=FALSE);

CREATE SEQUENCE groupbasket_redirect_system_id_seq
  INCREMENT 1
  MINVALUE 1
  MAXVALUE 9223372036854775807
725
  START 600
726
727
728
729
730
731
732
733
734
735
736
737
738
739
  CACHE 1;

CREATE TABLE groupbasket_redirect
(
  system_id integer NOT NULL DEFAULT nextval('groupbasket_redirect_system_id_seq'::regclass),
  group_id character varying(32) NOT NULL,
  basket_id character varying(32) NOT NULL,
  action_id int NOT NULL,
  entity_id character varying(32),
  keyword character varying(255),
  redirect_mode character varying(32) NOT NULL,
  CONSTRAINT groupbasket_redirect_pkey PRIMARY KEY (system_id)
)
WITH (OIDS=FALSE);
740

741
742
743
744
745
746
747
CREATE SEQUENCE email_signatures_id_seq
  INCREMENT 1
  MINVALUE 1
  MAXVALUE 9223372036854775807
  START 7
  CACHE 1;

Damien's avatar
Damien committed
748
CREATE TABLE users_email_signatures
749
750
751
752
753
754
755
756
757
758
(
  id bigint NOT NULL DEFAULT nextval('email_signatures_id_seq'::regclass),
  user_id character varying(255) NOT NULL,
  html_body text NOT NULL,
  title character varying NOT NULL,
  CONSTRAINT email_signatures_pkey PRIMARY KEY (id)
)
WITH (
  OIDS=FALSE
);
759

Jean-Louis ERCOLANI's avatar
Jean-Louis ERCOLANI committed
760
-- modules/folder/sql/structure/folder.postgresql.sql
761

762
763
764
765
CREATE SEQUENCE folders_system_id_seq
  INCREMENT 1
  MINVALUE 1
  MAXVALUE 9223372036854775807
Giovannoni Laurent's avatar
Giovannoni Laurent committed
766
  START 10000
767
768
769
770
771
772
773
774
775
776
777
778
779
  CACHE 1;

CREATE TABLE folders
(
  folders_system_id bigint NOT NULL DEFAULT nextval('folders_system_id_seq'::regclass),
  folder_id character varying(255) NOT NULL,
  foldertype_id integer,
  parent_id bigint DEFAULT (0)::bigint,
  folder_name character varying(255) DEFAULT NULL::character varying,
  subject character varying(255) DEFAULT NULL::character varying,
  description character varying(255) DEFAULT NULL::character varying,
  author character varying(255) DEFAULT NULL::character varying,
  typist character varying(255) DEFAULT NULL::character varying,
780
  status character varying(50) NOT NULL DEFAULT 'FOLDNEW'::character varying,
781
782
  folder_level smallint DEFAULT (1)::smallint,
  creation_date timestamp without time zone NOT NULL,
783
784
  destination character varying(50) DEFAULT NULL,
  dest_user character varying(128) DEFAULT NULL,
785
786
  folder_out_id bigint,
  video_status character varying(10) DEFAULT NULL,
787
  video_user character varying(128) DEFAULT NULL,
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
  is_frozen character(1) NOT NULL DEFAULT 'N',
  custom_t1 character varying(255) DEFAULT NULL::character varying,
  custom_n1 bigint,
  custom_f1 numeric,
  custom_d1 timestamp without time zone,
  custom_t2 character varying(255) DEFAULT NULL::character varying,
  custom_n2 bigint,
  custom_f2 numeric,
  custom_d2 timestamp without time zone,
  custom_t3 character varying(255) DEFAULT NULL::character varying,
  custom_n3 bigint,
  custom_f3 numeric,
  custom_d3 timestamp without time zone,
  custom_t4 character varying(255) DEFAULT NULL::character varying,
  custom_n4 bigint,
  custom_f4 numeric,
  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_d11 timestamp without time zone,
  custom_t12 character varying(255) DEFAULT NULL::character varying,
  custom_d12 timestamp without time zone,
  custom_t13 character varying(255) DEFAULT NULL::character varying,
  custom_d13 timestamp without time zone,
  custom_t14 character varying(255) DEFAULT NULL::character varying,
  custom_d14 timestamp without time zone,
  custom_t15 character varying(255) DEFAULT NULL::character varying,
  is_complete character(1) DEFAULT 'N'::bpchar,
  is_folder_out character(1) DEFAULT 'N'::bpchar,
  last_modified_date timestamp without time zone,
  CONSTRAINT folders_pkey PRIMARY KEY (folders_system_id)
)
WITH (OIDS=FALSE);

CREATE SEQUENCE foldertype_id_id_seq
  INCREMENT 1
  MINVALUE 1
  MAXVALUE 9223372036854775807
Giovannoni Laurent's avatar
Giovannoni Laurent committed
839
  START 200
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
  CACHE 1;

CREATE TABLE foldertypes
(
  foldertype_id  bigint NOT NULL DEFAULT nextval('foldertype_id_id_seq'::regclass),
  foldertype_label character varying(255) NOT NULL,
  maarch_comment text,
  retention_time character varying(50),
  custom_d1 character varying(10) DEFAULT '0000000000'::character varying,
  custom_f1 character varying(10) DEFAULT '0000000000'::character varying,
  custom_n1 character varying(10) DEFAULT '0000000000'::character varying,
  custom_t1 character varying(10) DEFAULT '0000000000'::character varying,
  custom_d2 character varying(10) DEFAULT '0000000000'::character varying,
  custom_f2 character varying(10) DEFAULT '0000000000'::character varying,
  custom_n2 character varying(10) DEFAULT '0000000000'::character varying,
  custom_t2 character varying(10) DEFAULT '0000000000'::character varying,
  custom_d3 character varying(10) DEFAULT '0000000000'::character varying,
  custom_f3 character varying(10) DEFAULT '0000000000'::character varying,
  custom_n3 character varying(10) DEFAULT '0000000000'::character varying,
  custom_t3 character varying(10) DEFAULT '0000000000'::character varying,
  custom_d4 character varying(10) DEFAULT '0000000000'::character varying,
  custom_f4 character varying(10) DEFAULT '0000000000'::character varying,
  custom_n4 character varying(10) DEFAULT '0000000000'::character varying,
  custom_t4 character varying(10) DEFAULT '0000000000'::character varying,
  custom_d5 character varying(10) DEFAULT '0000000000'::character varying,
  custom_f5 character varying(10) DEFAULT '0000000000'::character varying,
  custom_n5 character varying(10) DEFAULT '0000000000'::character varying,
  custom_t5 character varying(10) DEFAULT '0000000000'::character varying,
  custom_d6 character varying(10) DEFAULT '0000000000'::character varying,
  custom_t6 character varying(10) DEFAULT '0000000000'::character varying,
  custom_d7 character varying(10) DEFAULT '0000000000'::character varying,
  custom_t7 character varying(10) DEFAULT '0000000000'::character varying,
  custom_d8 character varying(10) DEFAULT '0000000000'::character varying,
  custom_t8 character varying(10) DEFAULT '0000000000'::character varying,
  custom_d9 character varying(10) DEFAULT '0000000000'::character varying,
  custom_t9 character varying(10) DEFAULT '0000000000'::character varying,
  custom_d10 character varying(10) DEFAULT '0000000000'::character varying,
  custom_t10 character varying(10) DEFAULT '0000000000'::character varying,
  custom_t11 character varying(10) DEFAULT '0000000000'::character varying,
  custom_t12 character varying(10) DEFAULT '0000000000'::character varying,
  custom_t13 character varying(10) DEFAULT '0000000000'::character varying,
  custom_t14 character varying(10) DEFAULT '0000000000'::character varying,
  custom_t15 character varying(10) DEFAULT '0000000000'::character varying,
  coll_id character varying(32),
  CONSTRAINT foldertypes_pkey PRIMARY KEY (foldertype_id)
)
WITH (OIDS=FALSE);

CREATE TABLE foldertypes_doctypes
(
  foldertype_id integer NOT NULL,
  doctype_id integer NOT NULL,
  CONSTRAINT foldertypes_doctypes_pkey PRIMARY KEY (foldertype_id, doctype_id)
)
WITH (OIDS=FALSE);

CREATE TABLE foldertypes_doctypes_level1
(
  foldertype_id integer NOT NULL,
  doctypes_first_level_id integer NOT NULL,
  CONSTRAINT foldertypes_doctypes_level1_pkey PRIMARY KEY (foldertype_id, doctypes_first_level_id)
)
WITH (OIDS=FALSE);

CREATE TABLE foldertypes_indexes
(
  foldertype_id bigint NOT NULL,
  field_name character varying(255) NOT NULL,
  mandatory character(1) NOT NULL DEFAULT 'N'::bpchar,
  CONSTRAINT foldertypes_indexes_pkey PRIMARY KEY (foldertype_id, field_name)
)
WITH (OIDS=FALSE);
912

Jean-Louis ERCOLANI's avatar
Jean-Louis ERCOLANI committed
913
914
915
916
-- modules/life_cycle/sql/structure/life_cycle.postgresql.sql

CREATE TABLE lc_policies
(
Giovannoni Laurent's avatar
Giovannoni Laurent committed
917
   policy_id character varying(32) NOT NULL,
Jean-Louis ERCOLANI's avatar
Jean-Louis ERCOLANI committed
918
919
920
   policy_name character varying(255) NOT NULL,
   policy_desc character varying(255) NOT NULL,
   CONSTRAINT lc_policies_pkey PRIMARY KEY (policy_id)
Giovannoni Laurent's avatar
Giovannoni Laurent committed
921
)
Jean-Louis ERCOLANI's avatar
Jean-Louis ERCOLANI committed
922
923
924
925
926
927
WITH (OIDS = FALSE);


CREATE TABLE lc_cycles
(
   policy_id character varying(32) NOT NULL,
Giovannoni Laurent's avatar
Giovannoni Laurent committed
928
   cycle_id character varying(32) NOT NULL,
Jean-Louis ERCOLANI's avatar
Jean-Louis ERCOLANI committed
929
930
   cycle_desc character varying(255) NOT NULL,
   sequence_number integer NOT NULL,
Giovannoni Laurent's avatar
Giovannoni Laurent committed
931
   where_clause text,
Jean-Louis ERCOLANI's avatar
Jean-Louis ERCOLANI committed
932
   break_key character varying(255) DEFAULT NULL,
Giovannoni Laurent's avatar
Giovannoni Laurent committed
933
   validation_mode character varying(32) NOT NULL,
Jean-Louis ERCOLANI's avatar
Jean-Louis ERCOLANI committed
934
   CONSTRAINT lc_cycle_pkey PRIMARY KEY (policy_id, cycle_id)
Giovannoni Laurent's avatar
Giovannoni Laurent committed
935
)
Jean-Louis ERCOLANI's avatar
Jean-Louis ERCOLANI committed
936
937
938
939
940
WITH (OIDS = FALSE);

CREATE TABLE lc_cycle_steps
(
   policy_id character varying(32) NOT NULL,
Giovannoni Laurent's avatar
Giovannoni Laurent committed
941
942
   cycle_id character varying(32) NOT NULL,
   cycle_step_id character varying(32) NOT NULL,
Jean-Louis ERCOLANI's avatar
Jean-Louis ERCOLANI committed
943
944
   cycle_step_desc character varying(255) NOT NULL,
   docserver_type_id character varying(32) NOT NULL,
Giovannoni Laurent's avatar
Giovannoni Laurent committed
945
   is_allow_failure character(1) NOT NULL DEFAULT 'N'::bpchar,
Jean-Louis ERCOLANI's avatar
Jean-Louis ERCOLANI committed
946
947
   step_operation character varying(32) NOT NULL,
   sequence_number integer NOT NULL,
Giovannoni Laurent's avatar
Giovannoni Laurent committed
948
   is_must_complete character(1) NOT NULL DEFAULT 'N'::bpchar,
Giovannoni Laurent's avatar
Giovannoni Laurent committed
949
   preprocess_script character varying(255) DEFAULT NULL,
Jean-Louis ERCOLANI's avatar
Jean-Louis ERCOLANI committed
950
951
   postprocess_script character varying(255) DEFAULT NULL,
   CONSTRAINT lc_cycle_steps_pkey PRIMARY KEY (policy_id, cycle_id, cycle_step_id, docserver_type_id)
Giovannoni Laurent's avatar
Giovannoni Laurent committed
952
)
Jean-Louis ERCOLANI's avatar
Jean-Louis ERCOLANI committed
953
954
955
956
957
WITH (OIDS = FALSE);

CREATE TABLE lc_stack
(
   policy_id character varying(32) NOT NULL,
Giovannoni Laurent's avatar
Giovannoni Laurent committed
958
959
   cycle_id character varying(32) NOT NULL,
   cycle_step_id character varying(32) NOT NULL,
Jean-Louis ERCOLANI's avatar
Jean-Louis ERCOLANI committed
960
   coll_id character varying(32) NOT NULL,
Giovannoni Laurent's avatar
Giovannoni Laurent committed
961
962
   res_id bigint NOT NULL,
   cnt_retry integer DEFAULT NULL,
Jean-Louis ERCOLANI's avatar
Jean-Louis ERCOLANI committed
963
   status character(1) NOT NULL,
964
965
   work_batch bigint,
   regex character varying(32),
Jean-Louis ERCOLANI's avatar
Jean-Louis ERCOLANI committed
966
   CONSTRAINT lc_stack_pkey PRIMARY KEY (policy_id, cycle_id, cycle_step_id, res_id)
Giovannoni Laurent's avatar
Giovannoni Laurent committed
967
)
Jean-Louis ERCOLANI's avatar
Jean-Louis ERCOLANI committed
968
969
970
971
972
WITH (OIDS = FALSE);



-- modules/notes/sql/structure/notes.postgresql.sql
973

974
975
976
977
978
979
980
981
982
983
984
985
986
CREATE SEQUENCE notes_seq
  INCREMENT 1
  MINVALUE 1
  MAXVALUE 9223372036854775807
  START 20
  CACHE 1;


CREATE TABLE notes
(
  id bigint NOT NULL DEFAULT nextval('notes_seq'::regclass),
  identifier bigint NOT NULL,
  tablename character varying(50),
987
  user_id character varying(128) NOT NULL,
988
  date_note timestamp without time zone NOT NULL,
989
990
991
992
993
  note_text text NOT NULL,
  coll_id character varying(50),
  CONSTRAINT notes_pkey PRIMARY KEY (id)
)
WITH (OIDS=FALSE);
994
995


SNA's avatar
SNA committed
996
997
998
999
1000
CREATE SEQUENCE notes_entities_id_seq
  INCREMENT 1
  MINVALUE 1
  MAXVALUE 9223372036854775807
  START 20
For faster browsing, not all history is shown. View entire blame