1 | <?php |
---|
2 | /** |
---|
3 | * |
---|
4 | * Copyright (C) 2011 Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br) |
---|
5 | * |
---|
6 | * This program is free software; you can redistribute it and/or modify |
---|
7 | * it under the terms of the GNU General Public License as published by |
---|
8 | * the Free Software Foundation; either version 3 of the License, or |
---|
9 | * any later version. |
---|
10 | * |
---|
11 | * This program is distributed in the hope that it will be useful, but WITHOUT |
---|
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
---|
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
---|
14 | * details. |
---|
15 | * |
---|
16 | * You should have received a copy of the GNU General Public License |
---|
17 | * along with this program; if not, write to the Free Software Foundation, |
---|
18 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
---|
19 | * |
---|
20 | * You can contact Prognus Software Livre headquarters at Av. Tancredo Neves, |
---|
21 | * 6731, PTI, EdifÃcio do Saber, 3º floor, room 306, Foz do Iguaçu - PR - Brasil |
---|
22 | * or at e-mail address prognus@prognus.com.br. |
---|
23 | * |
---|
24 | * Neste arquivo são inseridos os valores padrões nas tabelas do módulo expressoCalendar. |
---|
25 | * |
---|
26 | * @license http://www.gnu.org/copyleft/gpl.html GPL |
---|
27 | * @author Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br) |
---|
28 | * @version 1.0 |
---|
29 | * @sponsor Caixa EconÃŽmica Federal |
---|
30 | * @since Arquivo disponibilizado na versão Expresso 2.4.0 |
---|
31 | */ |
---|
32 | |
---|
33 | //Problemas com cascade na forenkey |
---|
34 | //calendar_object |
---|
35 | $oProc->query("ALTER TABLE calendar_object ADD CONSTRAINT fk_calendar_calendar_class FOREIGN KEY (class_id) REFERENCES calendar_class (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE;"); |
---|
36 | $oProc->query("ALTER TABLE calendar_object ADD CONSTRAINT fk_calendar_calendar_type FOREIGN KEY (type_id) REFERENCES calendar_object_type (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE;"); |
---|
37 | |
---|
38 | //calendar_to_calendar_object |
---|
39 | $oProc->query("ALTER TABLE calendar_to_calendar_object ADD CONSTRAINT fk_calendar_to_calendar_object_calendar FOREIGN KEY (calendar_id) REFERENCES calendar (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE;"); |
---|
40 | $oProc->query("ALTER TABLE calendar_to_calendar_object ADD CONSTRAINT fk_calendar_to_calendar_object_object FOREIGN KEY (calendar_object_id) REFERENCES calendar_object (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE;"); |
---|
41 | |
---|
42 | //calendar_attach |
---|
43 | $oProc->query("ALTER TABLE calendar_attach ADD CONSTRAINT fk_calendar_attach_attachment FOREIGN KEY (attach_id) REFERENCES attachment (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE;"); |
---|
44 | $oProc->query("ALTER TABLE calendar_attach ADD CONSTRAINT fk_calendar_attach_calendar FOREIGN KEY (object_id) REFERENCES calendar_object (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE;"); |
---|
45 | |
---|
46 | //calendar_participant |
---|
47 | $oProc->query("ALTER TABLE calendar_participant ADD CONSTRAINT fk_calendar_int_participant_calendar_object FOREIGN KEY (object_id) REFERENCES calendar_object (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE;"); |
---|
48 | $oProc->query("ALTER TABLE calendar_participant ADD CONSTRAINT fk_calendar_int_participant_calendar_participant_status FOREIGN KEY (participant_status_id) REFERENCES calendar_participant_status (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE;"); |
---|
49 | |
---|
50 | //calendar_alarm |
---|
51 | $oProc->query("ALTER TABLE calendar_alarm ADD CONSTRAINT fk_calendar_alarm_calendar_object FOREIGN KEY (object_id) REFERENCES calendar_object (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE;"); |
---|
52 | $oProc->query("ALTER TABLE calendar_alarm ADD CONSTRAINT fk_calendar_alarm_calendar_participant FOREIGN KEY (participant_id) REFERENCES calendar_participant (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE;"); |
---|
53 | |
---|
54 | //calendar_repeat |
---|
55 | $oProc->query("ALTER TABLE calendar_repeat ADD CONSTRAINT fk_calendar_repeat_calendar_object FOREIGN KEY (object_id) REFERENCES calendar_object (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE;"); |
---|
56 | |
---|
57 | //calendar_repeat_occurrence |
---|
58 | $oProc->query("ALTER TABLE calendar_repeat_occurrence ADD CONSTRAINT fk_calendar_repeat_to_calendar_repeat_occurrence FOREIGN KEY (repeat_id) REFERENCES calendar_repeat (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE;"); |
---|
59 | |
---|
60 | //calendar_signature |
---|
61 | $oProc->query("ALTER TABLE calendar_signature ADD CONSTRAINT fk_calendar_signature_calendar_espec FOREIGN KEY (calendar_id) REFERENCES calendar (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE;"); |
---|
62 | |
---|
63 | //calendar_signature_alarm |
---|
64 | $oProc->query("ALTER TABLE calendar_signature_alarm ADD CONSTRAINT fk_calendar_signature_alarm_calendar_signature FOREIGN KEY (calendar_signature_id) REFERENCES calendar_signature (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE;"); |
---|
65 | |
---|
66 | $oProc->query("ALTER TABLE calendar_signature ALTER COLUMN dtstamp SET DEFAULT (date_part('epoch'::text, ('now'::text)::timestamp(3) with time zone) * (1000)::double precision);"); |
---|
67 | |
---|
68 | $oProc->query("ALTER TABLE calendar ALTER COLUMN dtstamp SET DEFAULT (date_part('epoch'::text, ('now'::text)::timestamp(3) with time zone) * (1000)::double precision);"); |
---|
69 | |
---|
70 | $oProc->query("INSERT INTO calendar_object_type( \"id\", \"name\") VALUES ('1','VEVENT');"); |
---|
71 | $oProc->query("INSERT INTO calendar_class( \"id\", \"name\") VALUES ('1','Public'),('2','Private'),('3','Confidential');"); |
---|
72 | $oProc->query("INSERT INTO calendar_participant_status( \"id\", \"name\") VALUES ('1','CONFIRMED'),('2','TENTATIVE'),('3','CANCELLED'),('4','UNANSWERED'),('5', 'DELEGATED');"); |
---|
73 | |
---|
74 | //Admin conf |
---|
75 | $oProc->query("INSERT INTO phpgw_hooks( \"hook_appname\", \"hook_location\", \"hook_filename\") VALUES ('expressoCalendar','admin', 'hook_admin.inc.php');"); |
---|
76 | ?> |
---|