-
Notifications
You must be signed in to change notification settings - Fork 1
/
Fenice_Init_DB.sql
7181 lines (5380 loc) · 228 KB
/
Fenice_Init_DB.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
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
205
206
207
208
209
210
211
212
213
214
215
216
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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
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
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
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
839
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
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.1.1
-- Dumped by pg_dump version 9.5.5
-- Started on 2018-07-13 02:39:54
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
--
-- TOC entry 7 (class 2615 OID 294268)
-- Name: fenice; Type: SCHEMA; Schema: -; Owner: fenice
--
CREATE SCHEMA fenice;
ALTER SCHEMA fenice OWNER TO fenice;
--
-- TOC entry 1 (class 3079 OID 294270)
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- TOC entry 3193 (class 0 OID 0)
-- Dependencies: 1
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
SET search_path = fenice, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- TOC entry 163 (class 1259 OID 303263)
-- Name: acquisizione_massiva_logs; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE acquisizione_massiva_logs (
nome_file character varying(500) NOT NULL,
errore character varying(400),
aoo_id integer NOT NULL,
data_log timestamp without time zone DEFAULT now()
);
ALTER TABLE acquisizione_massiva_logs OWNER TO fenice;
--
-- TOC entry 268 (class 1259 OID 306072)
-- Name: allegati_doc_amm_trasparente; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE allegati_doc_amm_trasparente (
dc_id integer NOT NULL,
doc_sezione_id integer NOT NULL,
flag_riservato character(1) DEFAULT '0'::bpchar NOT NULL,
tipo integer NOT NULL,
flag_principale character(1) DEFAULT '0'::bpchar NOT NULL,
flag_pubblicabile character(1) DEFAULT '0'::bpchar
);
ALTER TABLE allegati_doc_amm_trasparente OWNER TO fenice;
--
-- TOC entry 259 (class 1259 OID 305715)
-- Name: allegati_doc_repertorio; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE allegati_doc_repertorio (
dc_id integer NOT NULL,
doc_repertorio_id integer NOT NULL,
flag_riservato character(1) DEFAULT '0'::bpchar NOT NULL,
tipo integer NOT NULL,
flag_principale character(1) DEFAULT '0'::bpchar NOT NULL,
flag_pubblicabile character(1) DEFAULT '0'::bpchar
);
ALTER TABLE allegati_doc_repertorio OWNER TO fenice;
--
-- TOC entry 266 (class 1259 OID 306022)
-- Name: amm_trasparente; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE amm_trasparente (
sezione_id integer NOT NULL,
aoo_id integer,
descrizione character varying(500),
ufficio_responsabile_id integer NOT NULL,
flag_web numeric(1,0) DEFAULT 0
);
ALTER TABLE amm_trasparente OWNER TO fenice;
--
-- TOC entry 267 (class 1259 OID 306041)
-- Name: amm_trasparente_documenti; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE amm_trasparente_documenti (
doc_id integer NOT NULL,
note text,
oggetto character varying(500),
capitolo character varying(50),
importo numeric(18,2),
data_validita_inizio timestamp without time zone,
data_validita_fine timestamp without time zone,
row_created_time timestamp without time zone DEFAULT now(),
row_created_user character varying(32),
row_updated_user character varying(32),
row_updated_time timestamp without time zone DEFAULT now(),
ufficio_id integer,
data_creazione timestamp without time zone,
sez_id integer,
numero_documento_sezione integer NOT NULL,
flag_stato integer DEFAULT 0 NOT NULL,
descrizione text,
numero_documento character varying(32),
settore_proponente character varying(255),
protocollo_id integer
);
ALTER TABLE amm_trasparente_documenti OWNER TO fenice;
--
-- TOC entry 164 (class 1259 OID 303270)
-- Name: amministrazione; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE amministrazione (
amministrazione_id integer NOT NULL,
codi_amministrazione character varying(20) NOT NULL,
desc_amministrazione character varying(254) NOT NULL,
row_created_time timestamp without time zone DEFAULT now(),
row_created_user character varying(32),
row_updated_user character varying(32),
row_updated_time timestamp without time zone DEFAULT now(),
versione integer DEFAULT 0 NOT NULL,
flag_ldap character(1) DEFAULT 0 NOT NULL,
ldap_versione integer,
ldap_porta integer DEFAULT 389,
ldap_use_ssl character(1) DEFAULT 0,
ldap_host character varying(256),
ldap_dn character varying(256),
path_doc character varying(255) NOT NULL,
path_doc_protocollo character varying(255),
flag_reg_separato character(1) DEFAULT 1 NOT NULL,
ftp_host character varying(100),
ftp_port integer DEFAULT 9990,
ftp_user character varying(100),
ftp_pass character varying(100),
id_unita_amministrativa integer DEFAULT 0,
versione_corrente_fenice character varying(10),
ftp_folder character varying(100),
flag_web_socket numeric(1,0) NOT NULL
);
ALTER TABLE amministrazione OWNER TO fenice;
--
-- TOC entry 244 (class 1259 OID 305107)
-- Name: amministrazioni_partecipanti; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE amministrazioni_partecipanti (
amministrazioni_id integer NOT NULL,
nominativo character varying(160),
rubrica_id integer,
tipo_procedimenti_id integer
);
ALTER TABLE amministrazioni_partecipanti OWNER TO fenice;
--
-- TOC entry 165 (class 1259 OID 303282)
-- Name: aree_organizzative; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE aree_organizzative (
aoo_id integer NOT NULL,
codi_aoo character varying(100) NOT NULL,
desc_aoo character varying(100) NOT NULL,
data_istituzione timestamp without time zone,
responsabile_nome character varying(40),
responsabile_cognome character varying(100),
responsabile_email character varying(100),
responsabile_telefono character varying(16),
data_soppressione timestamp without time zone,
telefono character varying(16),
fax character varying(16),
indi_dug character varying(10) NOT NULL,
indi_toponimo character varying(40) NOT NULL,
indi_civico character varying(10) NOT NULL,
indi_cap character varying(8) NOT NULL,
indi_comune character varying(50) NOT NULL,
email character varying(100),
dipartimento_codice character varying(10),
dipartimento_descrizione character varying(100),
tipo_aoo character(1) DEFAULT 'L'::bpchar NOT NULL,
provincia_id integer,
codi_documento_doc character varying(32),
flag_pdf character(1) DEFAULT '0'::bpchar NOT NULL,
amministrazione_id integer NOT NULL,
row_created_time timestamp without time zone DEFAULT now(),
row_created_user character varying(32),
row_updated_user character varying(32),
row_updated_time timestamp without time zone DEFAULT now(),
nume_blocco_titolario numeric(2,0),
versione integer DEFAULT 0 NOT NULL,
dipendenza_titolario_ufficio integer,
titolario_livello_minimo integer DEFAULT 0,
utente_responsabile_id integer,
flag_documento_readable numeric(1,0) DEFAULT 1,
flag_ricerca_full numeric(1,0) DEFAULT 1,
fattura_id_committente character varying(50),
ga_abilitata numeric(1,0) DEFAULT 0,
ga_username character varying(70),
ga_pwd character varying(50),
ga_flag_invio numeric(1,0) DEFAULT 0,
ga_timer time without time zone,
anni_visibilita_bacheca character varying(2) DEFAULT 1,
max_righe character varying(5) DEFAULT 1000,
flag_p7m integer DEFAULT 0,
CONSTRAINT aree_organizzative_flag_pdf_check CHECK ((((flag_pdf)::text = (1)::text) OR ((flag_pdf)::text = (0)::text))),
CONSTRAINT aree_organizzative_tipo_aoo_check CHECK (((tipo_aoo = 'F'::bpchar) OR (tipo_aoo = 'L'::bpchar)))
);
ALTER TABLE aree_organizzative OWNER TO fenice;
--
-- TOC entry 253 (class 1259 OID 305420)
-- Name: assegnatari_lista_distribuzione; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE assegnatari_lista_distribuzione (
id_assegnatario_lista integer NOT NULL,
id_lista integer NOT NULL,
id_carica integer,
id_ufficio integer,
row_created_time timestamp without time zone DEFAULT now(),
row_created_user character varying(32),
row_updated_user character varying(32),
row_updated_time timestamp without time zone DEFAULT now()
);
ALTER TABLE assegnatari_lista_distribuzione OWNER TO fenice;
--
-- TOC entry 166 (class 1259 OID 303298)
-- Name: ca_crl; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE ca_crl (
ca_id integer NOT NULL,
id integer NOT NULL,
url character varying(500) NOT NULL,
tipo character varying(20) NOT NULL,
data_emissione timestamp without time zone,
codice_errore integer DEFAULT 4 NOT NULL
);
ALTER TABLE ca_crl OWNER TO fenice;
--
-- TOC entry 167 (class 1259 OID 303305)
-- Name: ca_lista; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE ca_lista (
ca_id integer NOT NULL,
issuer_cn character varying(500) NOT NULL,
valido_dal timestamp without time zone NOT NULL,
valido_al timestamp without time zone NOT NULL,
certificato bytea
);
ALTER TABLE ca_lista OWNER TO fenice;
--
-- TOC entry 168 (class 1259 OID 303311)
-- Name: ca_revoked_list; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE ca_revoked_list (
ca_id integer NOT NULL,
data_revoca timestamp without time zone NOT NULL,
serial_number character varying(100) NOT NULL
);
ALTER TABLE ca_revoked_list OWNER TO fenice;
--
-- TOC entry 240 (class 1259 OID 304948)
-- Name: cariche; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE cariche (
carica_id integer NOT NULL,
denominazione character varying(160),
ufficio_id integer NOT NULL,
profilo_id integer,
utente_id integer,
versione integer DEFAULT 0 NOT NULL,
flag_attivo numeric(1,0) DEFAULT 1 NOT NULL,
row_created_time timestamp without time zone DEFAULT now(),
row_created_user character varying(32),
flag_dirigente numeric(1,0) DEFAULT 0,
flag_referente numeric(1,0) DEFAULT 0,
flag_responsabile_ente numeric(1,0) DEFAULT 0,
flag_referente_ufficio_protocollo numeric(1,0) DEFAULT 0
);
ALTER TABLE cariche OWNER TO fenice;
--
-- TOC entry 169 (class 1259 OID 303314)
-- Name: caselle_email; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE caselle_email (
casella_id integer NOT NULL,
server character varying(30) NOT NULL,
protocollo_tcp character varying(20) NOT NULL,
utente character varying(20) NOT NULL,
password character varying(20) NOT NULL,
indirizzo character varying(100) NOT NULL,
tipo character(1) NOT NULL,
ssl_porta character varying(5),
flag_ufficiale character(1) DEFAULT '0'::bpchar NOT NULL,
fk_aoo integer,
flag_ssl character(1) DEFAULT '0'::bpchar NOT NULL,
row_created_time timestamp without time zone DEFAULT now(),
row_created_user character varying(32),
row_updated_user character varying(32),
row_updated_time timestamp without time zone DEFAULT now(),
versione integer DEFAULT 0 NOT NULL,
CONSTRAINT caselle_email_flag_ssl_check CHECK ((((flag_ssl)::text = (1)::text) OR ((flag_ssl)::text = (0)::text))),
CONSTRAINT caselle_email_flag_ufficiale_check CHECK ((((flag_ufficiale)::text = (0)::text) OR ((flag_ufficiale)::text = (1)::text))),
CONSTRAINT caselle_email_tipo_check CHECK ((((tipo = 'I'::bpchar) OR (tipo = 'U'::bpchar)) OR (tipo = 'S'::bpchar)))
);
ALTER TABLE caselle_email OWNER TO fenice;
--
-- TOC entry 252 (class 1259 OID 305367)
-- Name: check_posta_interna; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE check_posta_interna (
check_id integer NOT NULL,
protocollo_id integer,
data_operazione timestamp with time zone,
ufficio_assegnante_id integer,
ufficio_assegnatario_id integer,
flag_competente numeric(1,0),
carica_assegnatario_id integer,
carica_assegnante_id integer,
check_presa_visione numeric(1,0) DEFAULT 0
);
ALTER TABLE check_posta_interna OWNER TO fenice;
--
-- TOC entry 170 (class 1259 OID 303331)
-- Name: doc_cartelle; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE doc_cartelle (
dc_id integer NOT NULL,
parent_id integer,
nome character varying(100) NOT NULL,
aoo_id integer NOT NULL,
is_root integer DEFAULT 0,
carica_id integer
);
ALTER TABLE doc_cartelle OWNER TO fenice;
--
-- TOC entry 3194 (class 0 OID 0)
-- Dependencies: 170
-- Name: TABLE doc_cartelle; Type: COMMENT; Schema: fenice; Owner: fenice
--
COMMENT ON TABLE doc_cartelle IS 'documentale, albero delle cartelle';
--
-- TOC entry 171 (class 1259 OID 303335)
-- Name: doc_file_attr; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE doc_file_attr (
dfa_id integer NOT NULL,
dc_id integer NOT NULL,
dfr_id integer,
nome character varying(100) NOT NULL,
versione integer NOT NULL,
row_created_time timestamp without time zone DEFAULT now(),
row_created_user character varying(150),
data_documento timestamp without time zone DEFAULT now(),
oggetto character varying(255),
note character varying(255),
descrizione character varying(255),
descrizione_argomento character varying(255),
tipo_documento_id integer,
titolario_id integer,
stato_lav character(1) DEFAULT 0 NOT NULL,
stato_arc character(1) DEFAULT 'L'::bpchar NOT NULL,
owner_id integer NOT NULL,
row_updated_time timestamp without time zone DEFAULT now(),
carica_lav_id integer,
procedimento_id integer
);
ALTER TABLE doc_file_attr OWNER TO fenice;
--
-- TOC entry 3195 (class 0 OID 0)
-- Dependencies: 171
-- Name: TABLE doc_file_attr; Type: COMMENT; Schema: fenice; Owner: fenice
--
COMMENT ON TABLE doc_file_attr IS 'documentale, attributi dei file';
--
-- TOC entry 172 (class 1259 OID 303346)
-- Name: doc_file_permessi; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE doc_file_permessi (
dfp_id integer NOT NULL,
dfa_id integer NOT NULL,
tipo_permesso integer NOT NULL,
ufficio_id integer,
versione integer DEFAULT 0 NOT NULL,
msg character varying(255),
carica_id integer
);
ALTER TABLE doc_file_permessi OWNER TO fenice;
--
-- TOC entry 173 (class 1259 OID 303350)
-- Name: doc_file_rep; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE doc_file_rep (
dfr_id integer NOT NULL,
data bytea,
filename character varying(500),
content_type character varying(100),
file_size integer,
impronta character varying(255),
row_created_time timestamp without time zone DEFAULT now(),
row_created_user character varying(32)
);
ALTER TABLE doc_file_rep OWNER TO fenice;
--
-- TOC entry 3196 (class 0 OID 0)
-- Dependencies: 173
-- Name: TABLE doc_file_rep; Type: COMMENT; Schema: fenice; Owner: fenice
--
COMMENT ON TABLE doc_file_rep IS 'documentale, file repository, contiene i file in formato binario';
--
-- TOC entry 174 (class 1259 OID 303357)
-- Name: documenti; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE documenti (
documento_id integer NOT NULL,
descrizione character varying(500),
filename character varying(500) NOT NULL,
content_type character varying(100),
file_size integer,
impronta character varying(255),
data bytea,
row_created_time timestamp without time zone DEFAULT now(),
row_created_user character varying(32),
path text
);
ALTER TABLE documenti OWNER TO fenice;
--
-- TOC entry 248 (class 1259 OID 305229)
-- Name: documenti_editor; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE documenti_editor (
documento_id integer NOT NULL,
txt text,
nome character varying(50),
row_created_time timestamp without time zone DEFAULT now(),
row_created_user character varying(32),
carica_id integer NOT NULL,
flag_stato integer DEFAULT 0 NOT NULL,
versione integer DEFAULT 0 NOT NULL,
oggetto text,
flag_tipo integer DEFAULT 0 NOT NULL,
msg_carica character varying(2000)
);
ALTER TABLE documenti_editor OWNER TO fenice;
--
-- TOC entry 258 (class 1259 OID 305700)
-- Name: documenti_repertori; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE documenti_repertori (
doc_repertorio_id integer NOT NULL,
note text,
oggetto character varying(500),
capitolo character varying(50),
importo numeric(18,2),
data_validita_inizio timestamp without time zone,
data_validita_fine timestamp without time zone,
row_created_time timestamp without time zone DEFAULT now(),
row_created_user character varying(32),
row_updated_user character varying(32),
row_updated_time timestamp without time zone DEFAULT now(),
ufficio_id integer,
data_creazione timestamp without time zone,
rep_id integer,
numero_documento_repertorio integer NOT NULL,
flag_stato integer DEFAULT 0 NOT NULL,
descrizione text,
numero_documento character varying(32),
settore_proponente character varying(255),
protocollo_id integer
);
ALTER TABLE documenti_repertori OWNER TO fenice;
--
-- TOC entry 175 (class 1259 OID 303364)
-- Name: email_coda_invio; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE email_coda_invio (
id integer NOT NULL,
aoo_id integer NOT NULL,
data_creazione date,
stato integer DEFAULT 0 NOT NULL,
protocollo_id integer NOT NULL,
data_invio date
);
ALTER TABLE email_coda_invio OWNER TO fenice;
--
-- TOC entry 176 (class 1259 OID 303368)
-- Name: email_coda_invio_destinatari; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE email_coda_invio_destinatari (
msg_id integer NOT NULL,
email character varying(200) NOT NULL,
nominativo character varying(200),
tipo character varying(5) NOT NULL
);
ALTER TABLE email_coda_invio_destinatari OWNER TO fenice;
--
-- TOC entry 177 (class 1259 OID 303371)
-- Name: email_ingresso; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE email_ingresso (
email_id integer NOT NULL,
descrizione character varying(500),
filename character varying(500) NOT NULL,
content_type character varying(100),
dimensione integer,
impronta character varying(255),
testo_messaggio bytea,
row_created_time timestamp without time zone DEFAULT now(),
row_created_user character varying(32),
email_mittente character varying(200),
nome_mittente character varying(200),
email_oggetto character varying(200),
data_spedizione timestamp without time zone,
data_ricezione timestamp without time zone,
segnatura bytea,
flag_stato integer DEFAULT 0 NOT NULL,
aoo_id integer NOT NULL,
flag_anomalia integer DEFAULT 0 NOT NULL,
message_header_id character varying(255)
);
ALTER TABLE email_ingresso OWNER TO fenice;
--
-- TOC entry 178 (class 1259 OID 303379)
-- Name: email_ingresso_allegati; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE email_ingresso_allegati (
id integer NOT NULL,
email_id integer NOT NULL,
descrizione character varying(500),
filename character varying(500) NOT NULL,
content_type character varying(100),
dimensione integer,
impronta character varying(255),
data bytea,
row_created_time timestamp without time zone DEFAULT now(),
row_created_user character varying(32)
);
ALTER TABLE email_ingresso_allegati OWNER TO fenice;
--
-- TOC entry 179 (class 1259 OID 303386)
-- Name: email_logs; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE email_logs (
email_id integer NOT NULL,
errore character varying(400),
tipo_log integer,
aoo_id integer NOT NULL,
data_log timestamp without time zone DEFAULT now()
);
ALTER TABLE email_logs OWNER TO fenice;
--
-- TOC entry 180 (class 1259 OID 303393)
-- Name: faldone_fascicoli; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE faldone_fascicoli (
faldone_id integer NOT NULL,
fascicolo_id integer NOT NULL,
row_created_time timestamp without time zone DEFAULT now(),
row_created_user character varying(32),
row_updated_user character varying(32),
row_updated_time timestamp without time zone DEFAULT now(),
versione integer DEFAULT 0 NOT NULL
);
ALTER TABLE faldone_fascicoli OWNER TO fenice;
--
-- TOC entry 181 (class 1259 OID 303399)
-- Name: faldone_procedimenti; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE faldone_procedimenti (
faldone_id integer NOT NULL,
procedimento_id integer NOT NULL
);
ALTER TABLE faldone_procedimenti OWNER TO fenice;
--
-- TOC entry 182 (class 1259 OID 303402)
-- Name: faldoni; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE faldoni (
faldone_id integer NOT NULL,
aoo_id integer NOT NULL,
oggetto character varying(500) NOT NULL,
ufficio_id integer NOT NULL,
titolario_id integer,
row_created_time timestamp without time zone DEFAULT now(),
row_created_user character varying(32),
row_updated_user character varying(32),
row_updated_time timestamp without time zone DEFAULT now(),
codice_locale character varying(20),
sotto_categoria character varying(250),
nota character varying(250),
numero_faldone character varying(11) NOT NULL,
anno integer DEFAULT 0 NOT NULL,
numero integer DEFAULT 0 NOT NULL,
data_creazione date NOT NULL,
data_carico timestamp without time zone,
data_scarico timestamp without time zone,
data_evidenza timestamp without time zone,
data_movimento timestamp without time zone,
stato_id integer,
versione integer DEFAULT 0 NOT NULL,
collocazione_label1 character varying(200),
collocazione_label2 character varying(200),
collocazione_label3 character varying(200),
collocazione_label4 character varying(200),
collocazione_valore1 character varying(200),
collocazione_valore2 character varying(200),
collocazione_valore3 character varying(200),
collocazione_valore4 character varying(200)
);
ALTER TABLE faldoni OWNER TO fenice;
--
-- TOC entry 183 (class 1259 OID 303413)
-- Name: fascicoli; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE fascicoli (
fascicolo_id integer NOT NULL,
aoo_id integer,
codice character varying(10),
progressivo numeric(18,0),
collocazione character varying(100),
note character varying(1024),
processo_id integer,
registro_id integer,
data_apertura timestamp without time zone,
data_chiusura timestamp without time zone,
stato integer,
row_created_time timestamp without time zone DEFAULT now(),
row_created_user character varying(32),
row_updated_user character varying(32),
row_updated_time timestamp without time zone DEFAULT now(),
titolario_id integer,
versione integer DEFAULT 0 NOT NULL,
ufficio_intestatario_id integer,
ufficio_responsabile_id integer,
data_evidenza timestamp without time zone,
anno_riferimento integer,
tipo integer DEFAULT 0 NOT NULL,
data_ultimo_movimento timestamp without time zone,
data_scarto timestamp without time zone,
data_carico timestamp without time zone,
data_scarico timestamp without time zone,
collocazione_label1 character varying(200),
collocazione_label2 character varying(200),
collocazione_label3 character varying(200),
collocazione_label4 character varying(200),
collocazione_valore1 character varying(200),
collocazione_valore2 character varying(200),
collocazione_valore3 character varying(200),
collocazione_valore4 character varying(200),
parent_id integer,
giorni_max integer,
giorni_alert integer,
oggetto text,
descrizione text,
nome text,
carica_istruttore_id integer,
carica_responsabile_id integer,
carica_intestatario_id integer,
comune character varying(50),
capitolo character varying(100),
path_progressivo character varying(100),
delegato character varying(200),
interessato character varying(200),
indi_delegato character varying(250),
indi_interessato character varying(250)
);
ALTER TABLE fascicoli OWNER TO fenice;
--
-- TOC entry 251 (class 1259 OID 305293)
-- Name: fascicolo_allacci; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE fascicolo_allacci (
fascicolo_id integer NOT NULL,
fascicolo_allacciato_id integer NOT NULL,
row_created_user character varying(32),
ufficio_proprietario_id integer
);
ALTER TABLE fascicolo_allacci OWNER TO fenice;
--
-- TOC entry 184 (class 1259 OID 303423)
-- Name: fascicolo_documenti; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE fascicolo_documenti (
dfa_id integer NOT NULL,
fascicolo_id integer NOT NULL,
row_created_time timestamp without time zone DEFAULT now(),
row_created_user character varying(32),
row_updated_user character varying(32),
row_updated_time timestamp without time zone DEFAULT now(),
versione integer DEFAULT 0 NOT NULL,
ufficio_proprietario_id integer
);
ALTER TABLE fascicolo_documenti OWNER TO fenice;
--
-- TOC entry 185 (class 1259 OID 303429)
-- Name: fascicolo_protocolli; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE fascicolo_protocolli (
protocollo_id integer NOT NULL,
fascicolo_id integer NOT NULL,
row_created_time timestamp without time zone DEFAULT now(),
row_created_user character varying(32),
row_updated_user character varying(32),
row_updated_time timestamp without time zone DEFAULT now(),
versione integer DEFAULT 0 NOT NULL,
ufficio_proprietario_id integer
);
ALTER TABLE fascicolo_protocolli OWNER TO fenice;
--
-- TOC entry 186 (class 1259 OID 303435)
-- Name: identificativi; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE identificativi (
nome_tabella character varying(128) NOT NULL,
id_corrente integer NOT NULL
);
ALTER TABLE identificativi OWNER TO fenice;
--
-- TOC entry 187 (class 1259 OID 303438)
-- Name: invio_classificati; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE invio_classificati (
id integer NOT NULL,
dfa_id integer NOT NULL,
aoo_id integer NOT NULL,
ufficio_mittente_id integer,
utente_mittente_id integer,
procedimento_id integer,
data_scadenza timestamp without time zone,
text_scadenza text
);
ALTER TABLE invio_classificati OWNER TO fenice;
--
-- TOC entry 188 (class 1259 OID 303441)
-- Name: invio_classificati_destinatari; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE invio_classificati_destinatari (
id integer NOT NULL,
dfa_id integer NOT NULL,
flag_tipo_destinatario character(1) NOT NULL,
indirizzo character varying(100),
email character varying(100),
destinatario character varying(160),
citta character varying(100),
data_spedizione timestamp without time zone,
flag_conoscenza character(1) DEFAULT '0'::bpchar NOT NULL,
data_effettiva_spedizione timestamp without time zone,
versione integer DEFAULT 0 NOT NULL,
titolo_id integer,
mezzo_spedizione integer,
CONSTRAINT invio_classificati_destinatari_flag_conoscenza_check CHECK (((flag_conoscenza = '1'::bpchar) OR (flag_conoscenza = '0'::bpchar))),
CONSTRAINT invio_classificati_destinatari_flag_tipo_destinatario_check CHECK ((((flag_tipo_destinatario = 'F'::bpchar) OR (flag_tipo_destinatario = 'G'::bpchar)) OR (flag_tipo_destinatario = 'A'::bpchar)))
);
ALTER TABLE invio_classificati_destinatari OWNER TO fenice;
--
-- TOC entry 250 (class 1259 OID 305261)
-- Name: invio_classificati_fascicoli; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE invio_classificati_fascicoli (
id integer NOT NULL,
dfa_id integer NOT NULL,
fascicolo_id integer NOT NULL
);
ALTER TABLE invio_classificati_fascicoli OWNER TO fenice;
--
-- TOC entry 189 (class 1259 OID 303448)
-- Name: invio_fascicoli; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE invio_fascicoli (
id integer NOT NULL,
fascicolo_id integer NOT NULL,
dfa_id integer NOT NULL,
flag_documento_principale character(1) DEFAULT '0'::bpchar NOT NULL,
aoo_id integer NOT NULL,
ufficio_mittente_id integer,
utente_mittente_id integer
);
ALTER TABLE invio_fascicoli OWNER TO fenice;
--
-- TOC entry 190 (class 1259 OID 303452)
-- Name: invio_fascicoli_destinatari; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE invio_fascicoli_destinatari (
id integer NOT NULL,
fascicolo_id integer NOT NULL,
flag_tipo_destinatario character(1) NOT NULL,
indirizzo character varying(100),
email character varying(100),
destinatario character varying(160),
citta character varying(100),
data_spedizione timestamp without time zone,
flag_conoscenza character(1) DEFAULT '0'::bpchar NOT NULL,
data_effettiva_spedizione timestamp without time zone,
versione integer DEFAULT 0 NOT NULL,
titolo_id integer,
mezzo_spedizione integer,
CONSTRAINT invio_fascicoli_destinatari_flag_conoscenza_check CHECK (((flag_conoscenza = '1'::bpchar) OR (flag_conoscenza = '0'::bpchar))),
CONSTRAINT invio_fascicoli_destinatari_flag_tipo_destinatario_check CHECK ((((flag_tipo_destinatario = 'F'::bpchar) OR (flag_tipo_destinatario = 'G'::bpchar)) OR (flag_tipo_destinatario = 'A'::bpchar)))
);
ALTER TABLE invio_fascicoli_destinatari OWNER TO fenice;
--
-- TOC entry 263 (class 1259 OID 305903)
-- Name: job_scheduled_logs; Type: TABLE; Schema: fenice; Owner: fenice
--
CREATE TABLE job_scheduled_logs (
js_id integer NOT NULL,
message character varying(400),
status integer,
aoo_id integer NOT NULL,
data_log date
);
ALTER TABLE job_scheduled_logs OWNER TO fenice;
--
-- TOC entry 191 (class 1259 OID 303459)
-- Name: lista_distribuzione; Type: TABLE; Schema: fenice; Owner: fenice