Subversion Repositories masonsql

Rev

Rev 297 | Blame | Compare with Previous | Last modification | View Log | RSS feed

--
-- PostgreSQL database dump
--

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

--
-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: postgres
--

CREATE PROCEDURAL LANGUAGE plpgsql;


ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO postgres;

SET search_path = public, pg_catalog;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- Name: anagrafiche; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE anagrafiche (
    id integer NOT NULL,
    nome character varying(20),
    cognome character varying(25),
    descrizione character varying(60),
    indirizzo character varying(60),
    provincia character varying(2),
    citta character varying(20),
    tel1 character varying(20),
    tel2 character varying(20),
    cell_sms character varying(20),
    codice_fiscale character(16),
    login character varying(60),
    password character(32),
    session character varying(60),
    email character varying(60),
    session_time timestamp without time zone,
    previus_session_time timestamp without time zone
);


ALTER TABLE public.anagrafiche OWNER TO postgres;

--
-- Name: TABLE anagrafiche; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE anagrafiche IS 'Anagrafiche persone';


--
-- Name: COLUMN anagrafiche.session_time; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN anagrafiche.session_time IS 'Istante di login dell''utente';


--
-- Name: COLUMN anagrafiche.previus_session_time; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN anagrafiche.previus_session_time IS 'Istante della precedente login dell''utente';


--
-- Name: anagrafiche_gruppi; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE anagrafiche_gruppi (
    id integer NOT NULL,
    id_anagrafiche integer NOT NULL,
    id_gruppi integer NOT NULL
);


ALTER TABLE public.anagrafiche_gruppi OWNER TO postgres;

--
-- Name: TABLE anagrafiche_gruppi; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE anagrafiche_gruppi IS 'Relazioni di appartenenza delle anagrafiche ai gruppi';


--
-- Name: anagrafiche_gruppi_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE anagrafiche_gruppi_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.anagrafiche_gruppi_id_seq OWNER TO postgres;

--
-- Name: anagrafiche_gruppi_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE anagrafiche_gruppi_id_seq OWNED BY anagrafiche_gruppi.id;


--
-- Name: anagrafiche_gruppi_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('anagrafiche_gruppi_id_seq', 3, true);


--
-- Name: anagrafiche_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE anagrafiche_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.anagrafiche_id_seq OWNER TO postgres;

--
-- Name: anagrafiche_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE anagrafiche_id_seq OWNED BY anagrafiche.id;


--
-- Name: anagrafiche_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('anagrafiche_id_seq', 3, true);


--
-- Name: autorizzazioni; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE autorizzazioni (
    id integer NOT NULL,
    nome character varying(16) NOT NULL,
    descrizione character varying(60),
    commento character varying(240)
);


ALTER TABLE public.autorizzazioni OWNER TO postgres;

--
-- Name: autorizzazioni_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE autorizzazioni_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.autorizzazioni_id_seq OWNER TO postgres;

--
-- Name: autorizzazioni_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE autorizzazioni_id_seq OWNED BY autorizzazioni.id;


--
-- Name: autorizzazioni_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('autorizzazioni_id_seq', 10, true);


--
-- Name: funzioni; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE funzioni (
    id integer NOT NULL,
    descrizione character varying(60),
    commento character varying(240),
    nome character varying(16) NOT NULL,
    menu_contents character varying(24),
    menu_status character varying(64),
    menu_ord smallint,
    menu_command character varying(1024),
    menu_cmdtype character(1),
    menu_father_id integer,
    help character varying
);


ALTER TABLE public.funzioni OWNER TO postgres;

--
-- Name: funzioni_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE funzioni_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.funzioni_id_seq OWNER TO postgres;

--
-- Name: funzioni_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE funzioni_id_seq OWNED BY funzioni.id;


--
-- Name: funzioni_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('funzioni_id_seq', 19, true);


--
-- Name: gruppi; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE gruppi (
    id integer NOT NULL,
    nome character varying(16),
    descrizione character varying(60),
    commento character varying(240)
);


ALTER TABLE public.gruppi OWNER TO postgres;

--
-- Name: gruppi_and_anagrafiche; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW gruppi_and_anagrafiche AS
    SELECT (- gruppi.id) AS id, gruppi.nome AS descrizione FROM gruppi UNION SELECT anagrafiche.id, (COALESCE(((anagrafiche.nome)::text || ' '::text), ''::text) || COALESCE((anagrafiche.cognome)::text, ''::text)) AS descrizione FROM anagrafiche WHERE (anagrafiche.login IS NOT NULL) ORDER BY 1;


ALTER TABLE public.gruppi_and_anagrafiche OWNER TO postgres;

--
-- Name: gruppi_funzioni; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE gruppi_funzioni (
    id integer NOT NULL,
    id_funzioni integer NOT NULL,
    id_gruppi integer NOT NULL,
    id_autorizzazioni integer NOT NULL
);


ALTER TABLE public.gruppi_funzioni OWNER TO postgres;

--
-- Name: gruppi_funzioni_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE gruppi_funzioni_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.gruppi_funzioni_id_seq OWNER TO postgres;

--
-- Name: gruppi_funzioni_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE gruppi_funzioni_id_seq OWNED BY gruppi_funzioni.id;


--
-- Name: gruppi_funzioni_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('gruppi_funzioni_id_seq', 396, true);


--
-- Name: gruppi_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE gruppi_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.gruppi_id_seq OWNER TO postgres;

--
-- Name: gruppi_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE gruppi_id_seq OWNED BY gruppi.id;


--
-- Name: gruppi_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('gruppi_id_seq', 4, true);


--
-- Name: gruppi_modifica; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE gruppi_modifica (
    id integer NOT NULL,
    id_gruppo integer NOT NULL,
    id_gruppo_modifica integer NOT NULL
);


ALTER TABLE public.gruppi_modifica OWNER TO postgres;

--
-- Name: gruppi_modifica_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE gruppi_modifica_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.gruppi_modifica_id_seq OWNER TO postgres;

--
-- Name: gruppi_modifica_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE gruppi_modifica_id_seq OWNED BY gruppi_modifica.id;


--
-- Name: gruppi_modifica_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('gruppi_modifica_id_seq', 1, false);


--
-- Name: logs; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE logs (
    id integer NOT NULL,
    "timestamp" timestamp without time zone DEFAULT now(),
    table_name character varying(63),
    old_value character varying,
    new_value character varying,
    id_anagrafiche integer,
    field character varying(63),
    id_record integer
);


ALTER TABLE public.logs OWNER TO postgres;

--
-- Name: TABLE logs; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE logs IS 'Log operazioni di inserimento, modifica e cancellazione effettuati dall''interfaccia Web
';


--
-- Name: COLUMN logs.id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN logs.id IS 'Primary key';


--
-- Name: COLUMN logs."timestamp"; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN logs."timestamp" IS 'Data e ora della modifica';


--
-- Name: COLUMN logs.table_name; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN logs.table_name IS 'Nome della tabella';


--
-- Name: COLUMN logs.old_value; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN logs.old_value IS 'Valore del campo prima della modifica';


--
-- Name: COLUMN logs.new_value; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN logs.new_value IS 'Valore del campo dopo la modifica';


--
-- Name: COLUMN logs.id_anagrafiche; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN logs.id_anagrafiche IS 'Utente responsabile della modifica';


--
-- Name: COLUMN logs.field; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN logs.field IS 'Nome del campo';


--
-- Name: logs_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE logs_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.logs_id_seq OWNER TO postgres;

--
-- Name: logs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE logs_id_seq OWNED BY logs.id;


--
-- Name: logs_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('logs_id_seq', 1, true);


SET default_with_oids = true;

--
-- Name: messages; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE messages (
    id integer NOT NULL,
    message character varying NOT NULL,
    owner integer NOT NULL,
    modification_time timestamp without time zone NOT NULL,
    transmission_time timestamp without time zone
);


ALTER TABLE public.messages OWNER TO postgres;

--
-- Name: messages_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE messages_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.messages_id_seq OWNER TO postgres;

--
-- Name: messages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE messages_id_seq OWNED BY messages.id;


--
-- Name: messages_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('messages_id_seq', 1, false);


SET default_with_oids = false;

--
-- Name: messages_users; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE messages_users (
    id integer NOT NULL,
    id_messages integer NOT NULL,
    id_anagrafiche integer NOT NULL,
    notification_time timestamp without time zone
);


ALTER TABLE public.messages_users OWNER TO postgres;

--
-- Name: messages_users_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE messages_users_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.messages_users_id_seq OWNER TO postgres;

--
-- Name: messages_users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE messages_users_id_seq OWNED BY messages_users.id;


--
-- Name: messages_users_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('messages_users_id_seq', 1, false);


--
-- Name: recordset; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE recordset (
    id integer NOT NULL,
    id_anagrafiche integer,
    name character varying(64) NOT NULL,
    size integer,
    block integer,
    query_numrec character varying,
    query_records character varying,
    query_where character varying,
    query_find_records character varying
);


ALTER TABLE public.recordset OWNER TO postgres;

--
-- Name: TABLE recordset; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE recordset IS 'Tabella per rendere persistenti i recordset utilizzati sul browser.
Le righe precaricate (con la chiave del record) sono inserite nella tabella recordset_rows.';


--
-- Name: COLUMN recordset.name; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN recordset.name IS 'Nome del recordset.
Corrisponde a .prefix indicato nell''oggetto databinding corrispondente che a sua volta corrisponde a $Recordset nel framework MasonSql';


--
-- Name: COLUMN recordset.block; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN recordset.block IS 'Dimensione del blocco utilizzato per il caricamento delle chiavi.';


--
-- Name: recordset_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE recordset_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.recordset_id_seq OWNER TO postgres;

--
-- Name: recordset_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE recordset_id_seq OWNED BY recordset.id;


--
-- Name: recordset_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('recordset_id_seq', 1, true);


--
-- Name: recordset_rows; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE recordset_rows (
    id integer NOT NULL,
    id_recordset integer NOT NULL,
    num_row integer NOT NULL,
    id_record integer
);


ALTER TABLE public.recordset_rows OWNER TO postgres;

--
-- Name: TABLE recordset_rows; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE recordset_rows IS 'Chiavi recordset (vedi tabella recordset).
Utilizzata nella gestione dei recordset persistenti.
';


--
-- Name: COLUMN recordset_rows.num_row; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN recordset_rows.num_row IS 'Riga nel recordset';


--
-- Name: COLUMN recordset_rows.id_record; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN recordset_rows.id_record IS 'Chiave del record';


--
-- Name: recordset_rows_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE recordset_rows_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.recordset_rows_id_seq OWNER TO postgres;

--
-- Name: recordset_rows_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE recordset_rows_id_seq OWNED BY recordset_rows.id;


--
-- Name: recordset_rows_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('recordset_rows_id_seq', 1, true);


--
-- Name: report_id; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE report_id (
    id integer NOT NULL,
    key integer NOT NULL,
    group_id integer NOT NULL
);


ALTER TABLE public.report_id OWNER TO postgres;

--
-- Name: report_id_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE report_id_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.report_id_id_seq OWNER TO postgres;

--
-- Name: report_id_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE report_id_id_seq OWNED BY report_id.id;


--
-- Name: report_id_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('report_id_id_seq', 1, true);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE anagrafiche ALTER COLUMN id SET DEFAULT nextval('anagrafiche_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE anagrafiche_gruppi ALTER COLUMN id SET DEFAULT nextval('anagrafiche_gruppi_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE autorizzazioni ALTER COLUMN id SET DEFAULT nextval('autorizzazioni_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE funzioni ALTER COLUMN id SET DEFAULT nextval('funzioni_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE gruppi ALTER COLUMN id SET DEFAULT nextval('gruppi_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE gruppi_funzioni ALTER COLUMN id SET DEFAULT nextval('gruppi_funzioni_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE gruppi_modifica ALTER COLUMN id SET DEFAULT nextval('gruppi_modifica_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE logs ALTER COLUMN id SET DEFAULT nextval('logs_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE messages ALTER COLUMN id SET DEFAULT nextval('messages_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE messages_users ALTER COLUMN id SET DEFAULT nextval('messages_users_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE recordset ALTER COLUMN id SET DEFAULT nextval('recordset_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE recordset_rows ALTER COLUMN id SET DEFAULT nextval('recordset_rows_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE report_id ALTER COLUMN id SET DEFAULT nextval('report_id_id_seq'::regclass);


--
-- Data for Name: anagrafiche; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY anagrafiche (id, nome, cognome, descrizione, indirizzo, provincia, citta, tel1, tel2, sell_sms, codice_fiscale, login, password, session, email, session_time, previus_session_time) FROM stdin;
3       Guest   Guest   \N      \N      \N      \N      \N      \N      \N      \N      guest   19ad89bc3e3c9d7ef68b89523eff1987        \N      \N      \N      \N
1       admin   \N      \N      \N      \N      \N      \N      \N      \N      \N      admin   8c31523d0c7e79c2594854a2fe62d3b5        172009872beb234c8bac09961375b8b4 10.115.1.2 21228904    \N      2010-05-13 08:52:34.868345      2010-05-13 07:51:40.19512
\.


--
-- Data for Name: anagrafiche_gruppi; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY anagrafiche_gruppi (id, id_anagrafiche, id_gruppi) FROM stdin;
1       1       1
3       3       4
\.


--
-- Data for Name: autorizzazioni; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY autorizzazioni (id, nome, descrizione, commento) FROM stdin;
8       Xls     Download dati in formato XLS    L'autorizzazione se concessa permette all'utente di scaricare i dati in formato XLS
4       Delete  Cancellazione dei dati  \N
2       Select  Lettura dei dati        \N
7       Insert  Inserimento nuovi valori        \N
1       Menu    Menu attivo     La voce di menù viene resa disponibile
5       Print   Stampa record corrente  \N
6       PrintSel        Stampa selezione dei record     \N
3       Update  Modifica dei dati       \N
9       Dbms    Interfaccia scambio dati /dbms  L'autorizzazione se concessa permette all'utente di scambiare dati attraverso l'interfaccia /dbms
10      Log     Visualizzazione delle modifiche nel tempo       Visualizza le modifiche apportate nel tempo con indicazione dell'utente
\.


--
-- Data for Name: funzioni; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY funzioni (id, descrizione, commento, nome, menu_contents, menu_status, menu_ord, menu_command, menu_cmdtype, menu_father_id, help) FROM stdin;
3       Help    \N      Help    ?       Help    900     \N      \N      \N      Menu principale Help.
7       Home Page       \N      HomePage        Home Page       Ricarica Home Page      10      "pageLoad('home.html?Ver=$Ver', '')"    J       14      Home Page.
12      Ricarica form corrente  \N      Reload  Ricarica        Ricarica form corrente  30      divReload(CurrentMenu); divReload(CurrentBody); j       3       Viene ricaricata dal server la funzione corrente.
4       Cambio password \N      ChangePass      Cambio password \N      90      "pageLoad('change_password.html?Ver=$Ver', '')" J       14      Help funzione Cambio password
8       Autorizzazioni  \N      ListAuth        Tipi autorizzazioni     Autorizzazioni  20      "pageLoad('table.html?Ver=$Ver&from=autorizzazioni', '')"       J       17      Classificazione delle autorizzazioni attribuibili ai gruppi a cui appartengono gli utenti.<br />\n<br />\n<ul>\n    <li>\n    <p align="left"><strong>Nome autorizzazione:&nbsp; </strong><span style=""></span></p>\n    </li>\n    <li>\n    <p align="left"><strong>Descrizione: </strong>Descrizione autorizzazione<br />\n    </p>\n    </li>\n    <li>\n    <p align="left"><strong>Commento: </strong>Commento di utilizzo libero</p>\n    </li>\n</ul>
9       Tabella funzioni        \N      Funzioni        Funzioni e autorizz.    Tabella funzioni dell'applicazione e autorizzazioni applicate   30      "pageLoad('table.html?Ver=$Ver&from=funzioni&children=TABLE&rows_child=10', '')"        J       17      Definizione dei men&ugrave; dell'applicazione e relativi permessi e documentazione.<br />\n<br />\n<ul>\n    <li>\n    <p align="left"><strong>Nome: </strong>Nome univoco della funzione. Al nome vengono associati i profili dei permessi usati&nbsp; anche nel codice. E' quindi importante&nbsp; non modificare il codice se non si &egrave;&nbsp; in grado di modificare anche i riferimenti nel codice dell'applicazione<span style=COLOR="#BC8F8F">""></span></p>\n    </li>\n    <li>\n    <p align="left"><strong>Descrizione: </strong>Descrizione della funzione</p>\n    </li>\n    <li>\n    <p align="left"><strong>Commento: </strong>Commento di utilizzo libero</p>\n    </li>\n    <li>\n    <p align="left"><strong>Ord: </strong>Numero che determina l'ordine con cui le varie voci di men&ugrave; compaiono<br />\n    </p>\n    </li>\n    <li>\n    <p align="left"><strong>Menu: </strong>Nome del men&ugrave; che appare nell'applicazione<strong><br />\n    </strong></p>\n    </li>\n    <li>\n    <p align="left&quot;><strong>Menu padre: </strong>Nome della funziona padre. La voce comparir&agrave; nel men&ugrave; sotto la voce del padre indicato. E' possibile indicare come padre delle voci di men&ugrave; che a voro volta hanno un padre.<br />\n    </p>\n    </li>\n    <li>\n    <p align="left"><strong>Menu avviso: </strong>Titolo del men&ugrave;<strong><br />\n    </strong></p>\n    </li>\n    <li>\n    <p align="left"><strong>Tipo comando:&nbsp;</strong></p>\n    <ul>\n        <li><strong>Link WEB: </strong>Il contenuto del campo <em>Comando Menu</em> verr&agrave; interpretato come link ad una pagina HTML<br />\n        </li>\n        <li><strong>Link WEB - applicando eval Perl: </strong>Al contenuto del campo viene applicata la funzione eval sul Server; utile per elaborare dei valori <em>(es. la variabile $Ver verr&agrave; sostituita con il numero di versione)</em><br />\n        </li>\n        <li><strong>Client Javascript: </strong>Il contenuto del campo <em>Comando Menu</em> verr&agrave; interpretato come codice javascript sul browser.<br />\n        </li>\n        <li><strong>Client Javascript</strong><strong> - applicando eval Perl: </strong>Al contenuto del campo viene applicata la funzione eval sul Server.</li>\n    </ul>\n    </li>\n    <li>\n    <p align="left"><strong>Comando Menu: </strong>Il comando, intepretato in funzione del campo <em>Tipo comando</em>.<strong><br />\n    </strong></p>\n    </li>\n    <li>\n    <p align="left"><strong>Permessi: </strong>Tabella di assegnazione dei permessi. In colonna vengono inseriti i vari tipi di autorizzazioni, mentre in riga troviamo le definizioni dei vari gruppi.<br />\n    </p>\n    </li>\n    <li>\n    <p align="left"><strong>Help: </strong>Documentazione della funzione a disposizione dell'utente. L'help dell'applicazione viene costruito assemblando la documentazione delle funzioni a cui l'utente ha accesso in base ai gruppi a cui appartiene.<strong><br />\n    </strong></p>\n    </li>\n</ul>
1       Modifiche nel database  Registrazione modifiche nel database da parte degli Utenti      Logs    Log database    Registrazione modifiche nel database da parte degli Utenti      999     "pageLoad('table.html?Ver=$Ver&from=logs', '')" J       17      Visualizza il registro delle mondifiche effettuate dagli utenti nel database.
14      Home    Raggruppamento homed    Home    Home    Home page applicazione SIDAL    1       \N      \N      \N      <h1 align="center">Introduzione</h1>\n<p>Questo programma permette la gestione integrata ....<br />\n</p>\n<span style="font-size: 10pt; font-family: Symbol;"></span>
2       Chiusura sessione       \N      CloseSession    Esci    Chiude sessione di lavoro       999     "logout.html?Ver=$Ver"  U       14      Chiusura sessione.
16      Tabella anagrafiche persone     \N      Anagrafiche     Anagrafica utenti       Tabella anagrafiche utenti      10      "pageLoad('/table.html?Ver=$Ver&from=anagrafiche&form=FORM&children=TABLE&rows_child=5', '')"   J       17      <h1 align="center">Anagrafica utenti</h1>\n<p align="justify">Archivio degli Utenti che accedono all'applicazione.</p>\n<p align="justify">Solo l'Utente con diritti di amministratore &egrave; in grado di modificare i dati degli Utenti.</p>\n<p align="justify">I campi dell'archivio, visualizzati nel &ldquo;form&rdquo;, sono:</p>\n<ul>\n    <li>\n    <p align="justify"><strong>Nome:</strong> Nome di battesimo dell'utente </p>\n    </li>\n    <li>\n    <p align="left"><strong>Cognome:</strong> Cognome dell'Utente</p>\n    </li>\n    <li>\n    <p align="left"><strong>C.F.:</strong> Codice fiscale; necessario se l'Utente &egrave; abilitato a firmare i Rapporti di prova, infatti viene utilizzato per la verifica del certificato di firma che deve quindi combaciare, assieme al Nome e Cognome.</p>\n    </li>\n    <li>\n    <p align="left"><strong>Indirizzo:</strong> Indirizzo di reperibilit&agrave;</p>\n    </li>\n    <li>\n    <p align="left"><strong>Provincia:</strong></p>\n    </li>\n    <li>\n    <p align="left"><strong>Citt&agrave;:</strong&gt;</p>\n    </li>\n    <li>\n    <p align="left"><strong>Telefono:</strong></p>\n    </li>\n    <li>\n    <p align="left"><strong>2&deg; Telefono:</strong></p>\n    </li>\n    <li>\n    <p align="left"><strong>Indirizzo e-mail:</strong></p>\n    </li>\n    <li>\n    <p align="left"><strong>Login:</strong> codice di accesso all'applicazione; Deve essere un codice univoco diverso quindi per ciascun Utente</p>\n    </li>\n    <li>\n    <p align="left"><strong>Password: </strong>password di almeno 8 caratteri. La password viene salvata nel database cifrata in modo da impedire la lettura anche all'Amministratore che pu&ograve; eventualmente cambiarla se l'Utente dovesse dimenticarla</p>\n    </li>\n    <li>\n    <p align="left"><strong>parametri su:</strong> Numero di righe da visualizzare della tabella dei parametri del form dei campioni prelevati</p>\n    </li>\n    <li>\n    <p align="left"><strong>in tabella:</strong> Se selezionato, i dati dei parametri dei Campioni prelevati, verranno allineati in formato tabella</p>\n    </li>\n    <li>\n    <p align="left" style="margin-bottom: 0cm;"><strong>Gruppi a cui appartiene l'utente: </strong>Lista dei gruppi a cui l'utente pu&ograve; appartenere:&lt;br />\n    </p>\n    <ul>\n        <li><strong>Admins: </strong>Amministratori dell'applicazione</li>\n        <li><strong>Guesti</strong>: Utenti ospiti (sol alettura)</li>\n    </ul>\n    </li>\n</ul>
13      Manuale di riferimento  Visualizza un Help dell'applicazione    HelpMain        Help    Help Analisi Chimiche   1       "pageLoad('/help.html?F=Home&Ver=$Ver', '/help.html?Ver=$Ver')" J       3       <span style="cursor: auto;" id="Father_FORM_funzioni">L'help dell'applicazione viene costruito assemblando la documentazione delle funzioni a cui l'utente ha accesso in base ai gruppi a cui appartiene.<br />\nLe varie funzioni vengono organizzate in un men&ugrave; ad albero visibile a sinistra, con il dettaglio visualizzato sulla destra.<br />\nLa documentazione &egrave; modificabile dagli utenti abilitati dalla funzione&nbsp; <em>Funzioni e autorizz.</em></span>
17      Impostazione delle autorizzazioni       \N      Autorizzazioni  Autorizzazioni  Impostazione delle autorizzazioni       5       \N      \N      \N      <div align="center"><font size="5"><span style="cursor: auto;" id="Father_autorizzazioni"><strong><strong>Autorizzazioni<br />\n<br />\n</strong></strong></span></font>\n<div align="left">\n<ul>\n    <li><font size="5"><span style="cursor: auto;" id="Father_autorizzazioni"><strong><strong><font size="2">Nome autorizzazione: </font></strong></strong><font size="2">Nome dell'autorizzazione</font><strong><strong><font size="2">&nbsp;  <br />\n    </font></strong></strong></span></font></li>\n</ul>\n<ul>\n    <li><font size="5"><span style="cursor: auto;" id="Father_autorizzazioni"><strong><strong><font size="2">Descrizione: </font></strong></strong><font size="2">Descrizione dell'autorizzazione<br />\n    </font></span></font></li>\n</ul>\n<ul>\n    <li><font size="5"><span style="cursor: auto;" id="Father_autorizzazioni"><strong><strong><font size="2">Commento: </font></strong></strong><font size="2">Eventuale commento<br />\n    </font></span></font></li>\n</ul>\n<font size="5"><span style="cursor: auto;" id="Father_autorizzazioni"></span></font></div>\n</div>
6       Note di release e Copyright     \N      Release Release Note di release e Copyright     20      "pageLoad('release_notes.html?Ver=$Ver', '')"   J       3       Note di release: ................<br />\n<br />\n<br />\n<br />\n<br />\n<div align="center"><br />\nFramework MasonSQL<br />\nCopyright (&copy;):<br />\nGuido Brugnara &lt;gdo@leader.it&gt;<br />\nLicenza G.P.L. Rel.2 <br />\n</div>\n<strong></strong>
10      Tabella gruppi  \N      Gruppi  Gruppi  Tabella gruppi  10      "pageLoad('/table.html?Ver=$Ver&from=gruppi&children=TABLE&rows_child=10', '')" J       17      <div align="center"><font size="4"><font size="5">GRUPPI</font><strong><br />\n<br />\n</strong></font></div>\nDefinizione dei gruppi a cui possono appartenere gli utenti che accedono all'applicazione.<br />\n<br />\n<ul>\n    <li>\n    <p align="left"><strong>Nome: </strong>Nome del gruppo<span style=""></span></p>\n    </li>\n    <li>\n    <p align="left"><strong>Descrizione: </strong>Descrizione del gruppo</p>\n    </li>\n    <li>\n    <p align="left"><strong>Commento: </strong>Commento di utilizzo libero</p>\n    </li>\n    <li>\n    <p align="left"><strong>Utenti del gruppo:</strong> Elenco degli utenti che appartengono al gruppo<span style="cursor: auto;" id="Child_gruppi_modifica"></span></p>\n    </li>\n    <li>\n    <p align="left"><span style="cursor: auto;" id="Child_gruppi_modifica"><strong><strong>Gruppi modificabili: </strong></strong>Elenco dei gruppi che utenti appartenenti al gruppo <FONT COLOR="#A020F0">in testata possono attribuire ad altri utenti.</span></p>\n    </li>\n</ul>\n<br />\n<span style="cursor: auto;" id="Child_gruppi_anagrafiche"><strong><strong>Utenti del gruppo</strong></strong></span><br />\nL'ambiente di base codifica i seguenti gruppi che non devono essere alterati:<br />\n<ul>\n    <li>\n    <p align="left"><strong>Admins:</strong> Gruppo&nbsp; <em>admin</em> di base dell'applicazione. E' un gruppo speciale che ha tutti i diritti.</p>\n    </li>\n</ul>\n<br />\n<span style="cursor: auto;" id="Child_gruppi_modifica"><strong><strong>Gruppi modificabili<br />\n</strong></strong></span>\n<ul>\n    <li>EnteAccett: Gruppo Accettazione Ente</li>\n</ul>\n<ul>\n    <li>EnteAdmin: Gruppo Amministratore ditta gestione</li>\n</ul>\n<ul>\n    <li>EnteChimico: Gruppo Chimico ditta gestione</li>\n</ul>\n<ul>\n    <li>EntePrelievo: Gruppo Tecnico prelievo ditta gestione</li>\n</ul>\n<ul>\n    <li>EnteResp: Gruppo Responsabile ditta gestione</li>\n</ul>\n<ul>\n    <li>EnteUser: Utente ditta gestione</li>\n</ul>\n<ul>\n    <li>PatAdmin: Gruppo Amministratore PAT</li>\n</ul>\n<ul>\n    <li>PatChimico: Chimico PAT</li>\n</ul>\n<ul>\n    <li>PatUser: Utente PAT</li>\n</ul>\n<br />\n<br />\n<br />\n<span style="cursor: auto;" id="Child_gruppi_modifica"><strong><strong></strong></strong></span>
18      Messaggi ed avvisi di sistema   \N      Messages        Messaggi        Messaggi ed avvisi di sistema   \N      "pageLoad('table.html?Ver=$Ver&from=messages&form=FORM', '')"   J       17      Gestione messaggi agli utenti
19      Messaggi inviati all'utente     \N      User_messages   Messaggi        Messaggi inviati all'utente     \N      "pageLoad('table.html?Ver=$Ver&from=user_messages&form=DIVS', '')"      J       14      Messaggi inviati all'utente
\.


--
-- Data for Name: gruppi; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY gruppi (id, nome, descrizione, commento) FROM stdin;
1       Admins  Amministratori  Utenti amministratori
4       Guest   Utenti ospiti (sola lettura)    \N
\.


--
-- Data for Name: gruppi_funzioni; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY gruppi_funzioni (id, id_funzioni, id_gruppi, id_autorizzazioni) FROM stdin;
331     13      1       1
332     13      4       1
333     14      1       1
334     14      4       1
335     17      1       1
336     17      4       1
337     7       1       1
338     7       4       1
339     10      1       4
340     10      1       7
341     10      1       1
342     10      1       5
343     10      1       6
344     10      1       2
345     10      1       3
346     10      1       8
347     10      4       1
348     10      4       2
349     16      1       4
350     16      1       7
351     16      1       1
352     16      1       5
353     16      1       6
354     16      1       2
355     16      1       3
356     16      4       1
357     16      4       2
360     8       1       4
361     8       1       7
362     8       1       1
363     8       1       2
364     8       1       3
365     8       1       8
366     9       1       4
367     9       1       7
368     9       1       1
369     9       1       2
370     9       1       3
371     9       1       8
372     12      1       1
373     12      4       1
374     4       1       1
375     4       4       1
376     3       1       1
377     3       4       1
381     2       1       1
382     2       4       1
383     1       1       1
384     1       1       2
385     1       1       8
386     18      1       4
387     18      1       7
388     18      1       1
389     18      1       2
390     18      1       3
391     19      1       1
392     19      1       2
393     19      4       1
394     19      4       2
395     6       1       1
396     6       4       1
\.


--
-- Data for Name: gruppi_modifica; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY gruppi_modifica (id, id_gruppo, id_gruppo_modifica) FROM stdin;
\.


--
-- Data for Name: logs; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY logs (id, "timestamp", table_name, old_value, new_value, id_anagrafiche, field, id_record) FROM stdin;
\.


--
-- Data for Name: messages; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY messages (id, message, owner, modification_time, transmission_time) FROM stdin;
\.


--
-- Data for Name: messages_users; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY messages_users (id, id_messages, id_anagrafiche, notification_time) FROM stdin;
\.


--
-- Data for Name: recordset; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY recordset (id, id_anagrafiche, name, size, block, query_numrec, query_records, query_where, query_find_records) FROM stdin;
\.


--
-- Data for Name: recordset_rows; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY recordset_rows (id, id_recordset, num_row, id_record) FROM stdin;
\.


--
-- Data for Name: report_id; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY report_id (id, key, group_id) FROM stdin;
\.


--
-- Name: anagrafiche_gruppi_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY anagrafiche_gruppi
    ADD CONSTRAINT anagrafiche_gruppi_pkey PRIMARY KEY (id);


--
-- Name: anagrafiche_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY anagrafiche
    ADD CONSTRAINT anagrafiche_pkey PRIMARY KEY (id);


--
-- Name: autorizzazioni_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY autorizzazioni
    ADD CONSTRAINT autorizzazioni_pkey PRIMARY KEY (id);


--
-- Name: funzioni_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY funzioni
    ADD CONSTRAINT funzioni_pkey PRIMARY KEY (id);


--
-- Name: gruppi_funzioni_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY gruppi_funzioni
    ADD CONSTRAINT gruppi_funzioni_pkey PRIMARY KEY (id);


--
-- Name: gruppi_modifica_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY gruppi_modifica
    ADD CONSTRAINT gruppi_modifica_pkey PRIMARY KEY (id);


--
-- Name: gruppi_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY gruppi
    ADD CONSTRAINT gruppi_pkey PRIMARY KEY (id);


--
-- Name: id_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY messages_users
    ADD CONSTRAINT id_pkey PRIMARY KEY (id);


--
-- Name: logs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY logs
    ADD CONSTRAINT logs_pkey PRIMARY KEY (id);


--
-- Name: messages_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY messages
    ADD CONSTRAINT messages_pkey PRIMARY KEY (id);


--
-- Name: recordset_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY recordset
    ADD CONSTRAINT recordset_pkey PRIMARY KEY (id);


--
-- Name: recordset_rows_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY recordset_rows
    ADD CONSTRAINT recordset_rows_pkey PRIMARY KEY (id);


--
-- Name: report_id_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY report_id
    ADD CONSTRAINT report_id_pkey PRIMARY KEY (id);


--
-- Name: anagrafiche_id_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX anagrafiche_id_idx ON recordset USING btree (id_anagrafiche);


--
-- Name: fki_logs_id_anagrafiche; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX fki_logs_id_anagrafiche ON logs USING btree (id_anagrafiche);


--
-- Name: fki_recordset_anagrafiche; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX fki_recordset_anagrafiche ON recordset USING btree (id_anagrafiche);


--
-- Name: fki_recordset_rows; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX fki_recordset_rows ON recordset_rows USING btree (id_recordset);


--
-- Name: logs_id_anagrafiche; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX logs_id_anagrafiche ON logs USING btree (id_anagrafiche);


--
-- Name: logs_table; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX logs_table ON logs USING btree (table_name);


--
-- Name: logs_timestamp; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX logs_timestamp ON logs USING btree ("timestamp");


--
-- Name: messages_date; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX messages_date ON messages USING btree (modification_time);


--
-- Name: messages_owner; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX messages_owner ON messages USING btree (owner);


--
-- Name: messages_users_id_anagrafiche; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX messages_users_id_anagrafiche ON messages_users USING btree (id_anagrafiche);


--
-- Name: messages_users_id_messages; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX messages_users_id_messages ON messages_users USING btree (id_messages);


--
-- Name: messages_users_notification_time; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX messages_users_notification_time ON messages_users USING btree (notification_time);


--
-- Name: prefix_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX prefix_idx ON recordset USING btree (name);


--
-- Name: recordset_rows_id_record; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX recordset_rows_id_record ON recordset_rows USING btree (id_record);


--
-- Name: recordset_rows_id_recordset; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX recordset_rows_id_recordset ON recordset_rows USING btree (id_recordset);


--
-- Name: recordset_rows_num_row; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX recordset_rows_num_row ON recordset_rows USING btree (num_row);


--
-- Name: recordset_rows_unique; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE UNIQUE INDEX recordset_rows_unique ON recordset_rows USING btree (id_recordset, id_record);


--
-- Name: anagrafiche_gruppi_id_anagrafiche; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY anagrafiche_gruppi
    ADD CONSTRAINT anagrafiche_gruppi_id_anagrafiche FOREIGN KEY (id_anagrafiche) REFERENCES anagrafiche(id) ON UPDATE RESTRICT ON DELETE CASCADE;


--
-- Name: anagrafiche_gruppi_id_gruppi; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY anagrafiche_gruppi
    ADD CONSTRAINT anagrafiche_gruppi_id_gruppi FOREIGN KEY (id_gruppi) REFERENCES gruppi(id) ON UPDATE RESTRICT ON DELETE CASCADE;


--
-- Name: gruppi_funzioni_id_autorizzazioni; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY gruppi_funzioni
    ADD CONSTRAINT gruppi_funzioni_id_autorizzazioni FOREIGN KEY (id_autorizzazioni) REFERENCES autorizzazioni(id) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- Name: gruppi_funzioni_id_funzioni; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY gruppi_funzioni
    ADD CONSTRAINT gruppi_funzioni_id_funzioni FOREIGN KEY (id_funzioni) REFERENCES funzioni(id) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- Name: gruppi_funzioni_id_gruppi; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY gruppi_funzioni
    ADD CONSTRAINT gruppi_funzioni_id_gruppi FOREIGN KEY (id_gruppi) REFERENCES gruppi(id) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- Name: gruppi_modifica_id_gruppo; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY gruppi_modifica
    ADD CONSTRAINT gruppi_modifica_id_gruppo FOREIGN KEY (id_gruppo) REFERENCES gruppi(id) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- Name: gruppi_modifica_id_gruppo_modifica; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY gruppi_modifica
    ADD CONSTRAINT gruppi_modifica_id_gruppo_modifica FOREIGN KEY (id_gruppo_modifica) REFERENCES gruppi(id) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- Name: logs_id_anagrafiche; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY logs
    ADD CONSTRAINT logs_id_anagrafiche FOREIGN KEY (id_anagrafiche) REFERENCES anagrafiche(id) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- Name: messages_users_messages; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY messages_users
    ADD CONSTRAINT messages_users_messages FOREIGN KEY (id_messages) REFERENCES messages(id) ON UPDATE RESTRICT ON DELETE CASCADE;


--
-- Name: recordset_anagrafiche; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY recordset
    ADD CONSTRAINT recordset_anagrafiche FOREIGN KEY (id_anagrafiche) REFERENCES anagrafiche(id) ON DELETE CASCADE;


--
-- Name: recordset_rows; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY recordset_rows
    ADD CONSTRAINT recordset_rows FOREIGN KEY (id_recordset) REFERENCES recordset(id) ON DELETE CASCADE;


--
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT USAGE ON SCHEMA public TO PUBLIC;


--
-- Name: anagrafiche; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON TABLE anagrafiche FROM PUBLIC;
REVOKE ALL ON TABLE anagrafiche FROM postgres;
GRANT ALL ON TABLE anagrafiche TO postgres;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE anagrafiche TO masonsql;
GRANT SELECT ON TABLE anagrafiche TO report;


--
-- Name: anagrafiche_gruppi; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON TABLE anagrafiche_gruppi FROM PUBLIC;
REVOKE ALL ON TABLE anagrafiche_gruppi FROM postgres;
GRANT ALL ON TABLE anagrafiche_gruppi TO postgres;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE anagrafiche_gruppi TO masonsql;
GRANT SELECT ON TABLE anagrafiche_gruppi TO report;


--
-- Name: anagrafiche_gruppi_id_seq; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON SEQUENCE anagrafiche_gruppi_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE anagrafiche_gruppi_id_seq FROM postgres;
GRANT ALL ON SEQUENCE anagrafiche_gruppi_id_seq TO postgres;
GRANT SELECT,UPDATE ON SEQUENCE anagrafiche_gruppi_id_seq TO masonsql;


--
-- Name: anagrafiche_id_seq; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON SEQUENCE anagrafiche_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE anagrafiche_id_seq FROM postgres;
GRANT ALL ON SEQUENCE anagrafiche_id_seq TO postgres;
GRANT SELECT,UPDATE ON SEQUENCE anagrafiche_id_seq TO masonsql;


--
-- Name: autorizzazioni; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON TABLE autorizzazioni FROM PUBLIC;
REVOKE ALL ON TABLE autorizzazioni FROM postgres;
GRANT ALL ON TABLE autorizzazioni TO postgres;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE autorizzazioni TO masonsql;
GRANT SELECT ON TABLE autorizzazioni TO report;


--
-- Name: autorizzazioni_id_seq; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON SEQUENCE autorizzazioni_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE autorizzazioni_id_seq FROM postgres;
GRANT ALL ON SEQUENCE autorizzazioni_id_seq TO postgres;
GRANT SELECT,UPDATE ON SEQUENCE autorizzazioni_id_seq TO masonsql;


--
-- Name: funzioni; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON TABLE funzioni FROM PUBLIC;
REVOKE ALL ON TABLE funzioni FROM postgres;
GRANT ALL ON TABLE funzioni TO postgres;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE funzioni TO masonsql;
GRANT SELECT ON TABLE funzioni TO report;


--
-- Name: funzioni_id_seq; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON SEQUENCE funzioni_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE funzioni_id_seq FROM postgres;
GRANT ALL ON SEQUENCE funzioni_id_seq TO postgres;
GRANT SELECT,UPDATE ON SEQUENCE funzioni_id_seq TO masonsql;


--
-- Name: gruppi; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON TABLE gruppi FROM PUBLIC;
REVOKE ALL ON TABLE gruppi FROM postgres;
GRANT ALL ON TABLE gruppi TO postgres;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE gruppi TO masonsql;
GRANT SELECT ON TABLE gruppi TO report;


--
-- Name: gruppi_and_anagrafiche; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON TABLE gruppi_and_anagrafiche FROM PUBLIC;
REVOKE ALL ON TABLE gruppi_and_anagrafiche FROM postgres;
GRANT ALL ON TABLE gruppi_and_anagrafiche TO postgres;
GRANT SELECT ON TABLE gruppi_and_anagrafiche TO report;
GRANT SELECT ON TABLE gruppi_and_anagrafiche TO masonsql;


--
-- Name: gruppi_funzioni; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON TABLE gruppi_funzioni FROM PUBLIC;
REVOKE ALL ON TABLE gruppi_funzioni FROM postgres;
GRANT ALL ON TABLE gruppi_funzioni TO postgres;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE gruppi_funzioni TO masonsql;
GRANT SELECT ON TABLE gruppi_funzioni TO report;


--
-- Name: gruppi_funzioni_id_seq; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON SEQUENCE gruppi_funzioni_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE gruppi_funzioni_id_seq FROM postgres;
GRANT ALL ON SEQUENCE gruppi_funzioni_id_seq TO postgres;
GRANT SELECT,UPDATE ON SEQUENCE gruppi_funzioni_id_seq TO masonsql;


--
-- Name: gruppi_id_seq; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON SEQUENCE gruppi_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE gruppi_id_seq FROM postgres;
GRANT ALL ON SEQUENCE gruppi_id_seq TO postgres;
GRANT SELECT,UPDATE ON SEQUENCE gruppi_id_seq TO masonsql;


--
-- Name: gruppi_modifica; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON TABLE gruppi_modifica FROM PUBLIC;
REVOKE ALL ON TABLE gruppi_modifica FROM postgres;
GRANT ALL ON TABLE gruppi_modifica TO postgres;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE gruppi_modifica TO masonsql;
GRANT SELECT ON TABLE gruppi_modifica TO report;


--
-- Name: gruppi_modifica_id_seq; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON SEQUENCE gruppi_modifica_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE gruppi_modifica_id_seq FROM postgres;
GRANT ALL ON SEQUENCE gruppi_modifica_id_seq TO postgres;
GRANT SELECT,UPDATE ON SEQUENCE gruppi_modifica_id_seq TO masonsql;


--
-- Name: logs; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON TABLE logs FROM PUBLIC;
REVOKE ALL ON TABLE logs FROM postgres;
GRANT ALL ON TABLE logs TO postgres;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE logs TO masonsql;
GRANT SELECT ON TABLE logs TO report;


--
-- Name: logs_id_seq; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON SEQUENCE logs_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE logs_id_seq FROM postgres;
GRANT ALL ON SEQUENCE logs_id_seq TO postgres;
GRANT SELECT,UPDATE ON SEQUENCE logs_id_seq TO masonsql;


--
-- Name: messages; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON TABLE messages FROM PUBLIC;
REVOKE ALL ON TABLE messages FROM postgres;
GRANT ALL ON TABLE messages TO postgres;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE messages TO masonsql;
GRANT SELECT ON TABLE messages TO report;


--
-- Name: messages_id_seq; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON SEQUENCE messages_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE messages_id_seq FROM postgres;
GRANT ALL ON SEQUENCE messages_id_seq TO postgres;
GRANT SELECT,UPDATE ON SEQUENCE messages_id_seq TO masonsql;


--
-- Name: messages_users; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON TABLE messages_users FROM PUBLIC;
REVOKE ALL ON TABLE messages_users FROM postgres;
GRANT ALL ON TABLE messages_users TO postgres;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE messages_users TO masonsql;
GRANT SELECT ON TABLE messages_users TO report;


--
-- Name: messages_users_id_seq; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON SEQUENCE messages_users_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE messages_users_id_seq FROM postgres;
GRANT ALL ON SEQUENCE messages_users_id_seq TO postgres;
GRANT SELECT,UPDATE ON SEQUENCE messages_users_id_seq TO masonsql;


--
-- Name: recordset; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON TABLE recordset FROM PUBLIC;
REVOKE ALL ON TABLE recordset FROM postgres;
GRANT ALL ON TABLE recordset TO postgres;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE recordset TO masonsql;


--
-- Name: recordset_id_seq; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON SEQUENCE recordset_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE recordset_id_seq FROM postgres;
GRANT ALL ON SEQUENCE recordset_id_seq TO postgres;
GRANT SELECT,UPDATE ON SEQUENCE recordset_id_seq TO masonsql;


--
-- Name: recordset_rows; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON TABLE recordset_rows FROM PUBLIC;
REVOKE ALL ON TABLE recordset_rows FROM postgres;
GRANT ALL ON TABLE recordset_rows TO postgres;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE recordset_rows TO masonsql;


--
-- Name: recordset_rows_id_seq; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON SEQUENCE recordset_rows_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE recordset_rows_id_seq FROM postgres;
GRANT ALL ON SEQUENCE recordset_rows_id_seq TO postgres;
GRANT SELECT,UPDATE ON SEQUENCE recordset_rows_id_seq TO masonsql;


--
-- Name: report_id; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON TABLE report_id FROM PUBLIC;
REVOKE ALL ON TABLE report_id FROM postgres;
GRANT ALL ON TABLE report_id TO postgres;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE report_id TO masonsql;
GRANT SELECT ON TABLE report_id TO report;


--
-- Name: report_id_id_seq; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON SEQUENCE report_id_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE report_id_id_seq FROM postgres;
GRANT ALL ON SEQUENCE report_id_id_seq TO postgres;
GRANT SELECT,UPDATE ON SEQUENCE report_id_id_seq TO masonsql;


--
-- PostgreSQL database dump complete
--

CREATE TABLE logs_report
(
  id integer NOT NULL DEFAULT nextval(('logs_report_seq'::text)::regclass), -- Primary key
  "timestamp" timestamp without time zone NOT NULL, -- Data e ora della modifica
  table_name character varying(63) NOT NULL, -- Nome della tabella
  report character varying(64000), -- Riepilogo delle variazioni
  id_anagrafiche integer, -- Utente responsabile della modifica
  id_record integer NOT NULL, -- ID record modificato
  CONSTRAINT logs_report_pkey PRIMARY KEY (id ),
  CONSTRAINT logs_report_id_anagrafiche FOREIGN KEY (id_anagrafiche)
      REFERENCES anagrafiche (id) MATCH SIMPLE
      ON UPDATE RESTRICT ON DELETE RESTRICT
)
WITH (
  OIDS=FALSE
);
ALTER TABLE logs_report
  OWNER TO postgres;
GRANT ALL ON TABLE logs_report TO postgres;
GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE logs_report TO masonsql;
GRANT SELECT ON TABLE logs_report TO report;
COMMENT ON TABLE logs_report IS 'Report delle operazioni di variazione dei dati effettuati dall''interfaccia Web';
COMMENT ON COLUMN logs_report.id IS 'Primary key';
COMMENT ON COLUMN logs_report."timestamp" IS 'Data e ora della modifica';
COMMENT ON COLUMN logs_report.table_name IS 'Nome della tabella';
COMMENT ON COLUMN logs_report.report IS 'Riepilogo delle variazioni';
COMMENT ON COLUMN logs_report.id_anagrafiche IS 'Utente responsabile della modifica';
COMMENT ON COLUMN logs_report.id_record IS 'ID record modificato';


-- Index: logs_report_id_anagrafiche

-- DROP INDEX logs_report_id_anagrafiche;

CREATE INDEX logs_report_id_anagrafiche
  ON logs_report
  USING btree
  (id_anagrafiche );

-- Index: logs_report_id_record

-- DROP INDEX logs_report_id_record;

CREATE INDEX logs_report_id_record
  ON logs_report
  USING btree
  (id_record );

-- Index: logs_report_table

-- DROP INDEX logs_report_table;

CREATE INDEX logs_report_table
  ON logs_report
  USING btree
  (table_name );

-- Index: logs_report_timestamp

-- DROP INDEX logs_report_timestamp;

CREATE INDEX logs_report_timestamp
  ON logs_report
  USING btree
  ("timestamp" );

GRANT SELECT ON TABLE funzioni TO report;
GRANT SELECT ON TABLE gruppi_funzioni TO report;
GRANT SELECT ON TABLE autorizzazioni TO report;