source: trunk/expressoCalendar/setup/default_records.inc.php @ 5804

Revision 5804, 4.3 KB checked in by acoutinho, 11 years ago (diff)

Ticket #2434 - Implementada funcionalidade de criacao de agenda para contas compartilhadas e imposicao de agendas

Line 
1<?php
2
3                //Problemas com cascade na forenkey
4                //calendar_object
5                $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;");
6                $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;");
7               
8                //calendar_to_calendar_object
9                $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;");
10                $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;");
11               
12                //calendar_attach
13                $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;");
14                $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;");
15               
16                //calendar_participant
17                $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;");
18                $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;");
19               
20                //calendar_alarm
21                $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;");
22                $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;");
23               
24                //calendar_repeat
25                $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;");
26
27                //calendar_repeat_occurrence
28                $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;");     
29
30                //calendar_signature
31                $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;");
32               
33                //calendar_signature_alarm
34                $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;");
35               
36                $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);");
37               
38                $oProc->query("ALTER TABLE calendar ALTER COLUMN dtstamp SET DEFAULT (date_part('epoch'::text, ('now'::text)::timestamp(3) with time zone) * (1000)::double precision);");
39       
40                $oProc->query("INSERT INTO calendar_object_type( \"id\", \"name\") VALUES ('1','VEVENT');");
41                $oProc->query("INSERT INTO calendar_class( \"id\", \"name\") VALUES ('1','Public'),('2','Private'),('3','Confidential');");
42                $oProc->query("INSERT INTO calendar_participant_status( \"id\", \"name\") VALUES ('1','CONFIRMED'),('2','TENTATIVE'),('3','CANCELLED'),('4','UNANSWERED'),('5', 'DELEGATED');");
43
44                //Admin conf
45                $oProc->query("INSERT INTO phpgw_hooks( \"hook_appname\", \"hook_location\", \"hook_filename\") VALUES ('expressoCalendar','admin', 'hook_admin.inc.php');");
46?>
Note: See TracBrowser for help on using the repository browser.