function calendar_install

7.x calendar.install calendar_install()
6.x calendar.install calendar_install()

Hook install. Called when the module is installed on the admin modules page.

File

modules/calendar/calendar.install, line 13

Code

function calendar_install() {

  $q = "
CREATE TABLE `content__appointment` (
  `cid` int(10) unsigned NOT NULL,
  `vid` int(10) unsigned NOT NULL, 
  `field__appointment_datetime` datetime DEFAULT NULL,
  `field__appointment_duration_minutes` int(11) DEFAULT NULL,
  `field__faculty_id` varchar(255) DEFAULT NULL,
  `field__student_id` varchar(255) DEFAULT NULL,
  `field__appointment_type` varchar(255) DEFAULT NULL,
  `field__appointment_msg` longtext DEFAULT NULL,
  `field__video_data` longtext DEFAULT NULL,
  PRIMARY KEY (`vid`),
  KEY `cid` (`cid`),
  KEY `field__appointment_datetime` (`field__appointment_datetime`),
  KEY `field__duration_minutes` (`field__appointment_duration_minutes`),
  KEY `faculty_id` (`field__faculty_id`),
  KEY `student_id` (`field__student_id`),
  KEY `appointment_type` (`field__appointment_type`)
);  
  ";
  db_query($q);


  $q = "
CREATE TABLE `content__schedule_event_type` (
  `cid` int(10) unsigned NOT NULL,
  `vid` int(10) unsigned NOT NULL,
  `field__faculty_id` varchar(255) DEFAULT NULL,
  `field__enabled` varchar(50) DEFAULT NULL,
  `field__event_duration_minutes` int(11) DEFAULT NULL,
  `field__event_buffer_minutes` int(11) DEFAULT NULL,
  `field__prevent_less_than_hours` int(11) DEFAULT NULL,
  `field__additional_email_msg` longtext DEFAULT NULL,
  `field__description` longtext DEFAULT NULL,
  `field__video_meeting` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`vid`),
  KEY `cid` (`cid`),
  KEY `field__faculty_id` (`field__faculty_id`),
  KEY `field__event_duration_minutes` (`field__event_duration_minutes`),
  KEY `field__event_buffer_minutes` (`field__event_buffer_minutes`),
  KEY `field__prevent_less_than_hours` (`field__prevent_less_than_hours`),
  KEY `field__enabled` (`field__enabled`),
  KEY `field__video_meeting` (`field__video_meeting`)
);   
  ";
  db_query($q);


  $q = "
CREATE TABLE `content__schedule_unavailable_time` (
  `cid` int(10) unsigned NOT NULL,
  `vid` int(10) unsigned NOT NULL,
  `field__faculty_id` varchar(255) DEFAULT NULL,
  `field__days` text DEFAULT NULL,
  `field__time_selector` varchar(255) DEFAULT NULL,
  `field__day_start_hour` varchar(255) DEFAULT NULL,
  `field__day_stop_hour` varchar(255) DEFAULT NULL,
  `field__start_time` varchar(255) DEFAULT NULL,
  `field__end_time` varchar(255) DEFAULT NULL,
  `field__ics_url` text DEFAULT NULL,
  PRIMARY KEY (`vid`),
  KEY `cid` (`cid`),
  KEY `field__start_time` (`field__start_time`),
  KEY `field__end_time` (`field__end_time`),
  KEY `field__ics_url` (`field__ics_url`(700)),
  KEY `field__faculty_id` (`field__faculty_id`),
  KEY `field__time_selector` (`field__time_selector`),
  KEY `field__day_start_hour` (`field__day_start_hour`),
  KEY `field__day_stop_hour` (`field__day_stop_hour`)
);  
  ";
  db_query($q);









}