function system_install

7.x system.install system_install()
6.x system.install system_install()
4.x system.install system_install()
5.x system.install system_install()

Implementation of hook_install.

This will create all of our tables.

1 call to system_install()
install_perform_install in ./install.php
Actually performs the installation of FlightPath

File

modules/system/system.install, line 184
The install file for the System module

Code

function system_install() {

  // Since this will ONLY be called during initial install, we do not
  // need to first check for existing tables; it is assumed that the database
  // is empty.

  // Therefore, let's place all of our create table statements in one query, for
  // simplicity.

  $q = "
CREATE TABLE `advised_courses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `advising_session_id` int(11) DEFAULT '0',
  `course_id` int(11) DEFAULT '0',
  `entry_value` varchar(20) DEFAULT '',
  `semester_num` int(11) DEFAULT '0',
  `group_id` varchar(50) DEFAULT '',
  `var_hours` decimal(8,4) DEFAULT '0.0000',
  `term_id` varchar(20) DEFAULT '',
  `degree_id` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `advid` (`advising_session_id`),
  KEY `course_id` (`course_id`),
  KEY `ev` (`entry_value`),
  KEY `degree_id` (`degree_id`),
  KEY `term_id` (`term_id`),
  KEY `semester_num` (`semester_num`)
);   ";


  db_query($q);

  $q = "  
  
CREATE TABLE `advising_comments` (
  `id` int(11)   AUTO_INCREMENT,
  `student_id` varchar(30)   DEFAULT '0',
  `faculty_id` varchar(30)   DEFAULT '0',
  `term_id` varchar(20)   DEFAULT '',
  `comment` text,
  `posted` int(10) unsigned   DEFAULT '0',
  `access_type` varchar(20)   DEFAULT '',
  `delete_flag` tinyint(4)   DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `student_id` (`student_id`),
  KEY `delete_flag` (`delete_flag`), 
  KEY `access_type` (`access_type`)
);
  ";

  db_query($q);

  $q = "
CREATE TABLE `advising_sessions` (
  `advising_session_id` int(11)   AUTO_INCREMENT,
  `student_id` varchar(30)   DEFAULT '0',
  `faculty_id` varchar(30)   DEFAULT '0',
  `term_id` varchar(20)   DEFAULT '',
  `degree_id` int(11)   DEFAULT '0',
  `major_code_csv` varchar(255)   DEFAULT '',
  `catalog_year` int(11)   DEFAULT '0',
  `posted` int(10) unsigned   DEFAULT '0',
  `is_whatif` tinyint(4)   DEFAULT '0',
  `is_draft` tinyint(4)   DEFAULT '0',
  `is_empty` tinyint(4)   DEFAULT '0',
  PRIMARY KEY (`advising_session_id`),
  KEY `sid` (`student_id`),
  KEY `termid` (`term_id`)
);  ";
  db_query($q);

  $q = "

CREATE TABLE `advisor_student` (
  `faculty_id` varchar(30)   DEFAULT '0',
  `student_id` varchar(30)   DEFAULT '0',
  PRIMARY KEY (`faculty_id`,`student_id`)
); ";

  db_query($q);

  $q = "
CREATE TABLE `blocks` (
  `bid` int(10) unsigned   AUTO_INCREMENT,
  `section` varchar(255)   DEFAULT '',
  `region` varchar(255)   DEFAULT '',
  `module` varchar(255)   DEFAULT '',
  `delta` varchar(255)   DEFAULT '',
  `weight` int(11)   DEFAULT '0',
  PRIMARY KEY (`bid`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `courses` (
  `id` int(11)   AUTO_INCREMENT,
  `course_id` int(11)   DEFAULT '0',
  `subject_id` varchar(10)   DEFAULT '',
  `course_num` varchar(10)   DEFAULT '',
  `catalog_year` int(11)   DEFAULT '0',
  `title` text,
  `description` text,
  `min_hours` decimal(8,4)   DEFAULT '0.0000',
  `max_hours` decimal(8,4)   DEFAULT '0.0000',
  `repeat_hours` decimal(8,4)   DEFAULT '0.0000',
  `exclude` tinyint(4)   DEFAULT '0',
  `data_entry_comment` text,
  `delete_flag` tinyint(4)   DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `course_id` (`course_id`),
  KEY `subject_id` (`subject_id`),
  KEY `course_num` (`course_num`),
  KEY `catalog_year` (`catalog_year`)
); ";
  db_query($q);


  db_query("CREATE TABLE `colleges` (
            `college_code` varchar(10)  ,
            `title` varchar(255)   DEFAULT '',
            PRIMARY KEY (`college_code`)
            ) ");

  db_query("CREATE TABLE `degree_college` (
            `major_code` varchar(100)   DEFAULT '',
            `college_code` varchar(10)   DEFAULT '',
            PRIMARY KEY (`major_code`),
            KEY `college_code` (`college_code`)
          ) ");


  $q = "
CREATE TABLE `degree_requirements` (
  `id` int(11)   AUTO_INCREMENT,
  `degree_id` int(11)   DEFAULT '0',
  `semester_num` int(11)   DEFAULT '0',
  `group_id` int(11)   DEFAULT '0',
  `group_requirement_type` varchar(10)   DEFAULT '',
  `group_min_hours_allowed` decimal(8,4)   DEFAULT '0.0000',
  `group_hours_required` decimal(8,4)   DEFAULT '0.0000',
  `group_min_grade` varchar(10)   DEFAULT '',
  `course_id` int(11)   DEFAULT '0',
  `course_min_grade` varchar(10)   DEFAULT '',
  `course_requirement_type` varchar(10)   DEFAULT '',
  `data_entry_value` varchar(50)   DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `degree_id` (`degree_id`),
  KEY `group_id` (`group_id`),
  KEY `dev` (`data_entry_value`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `degree_tracks` (
  `track_id` int(11)   AUTO_INCREMENT,
  `catalog_year` int(11)   DEFAULT '2006',
  `major_code` varchar(100)   DEFAULT '',
  `track_code` varchar(20)   DEFAULT '',
  `track_title` varchar(100)   DEFAULT '',
  `track_short_title` varchar(50)   DEFAULT '',
  `track_description` text,
  PRIMARY KEY (`track_id`)
);  ";
  db_query($q);

  $q = "
CREATE TABLE `degrees` (
  `id` int(11)   AUTO_INCREMENT,
  `degree_id` int(11)   DEFAULT '0',
  `major_code` varchar(100)   DEFAULT '',
  `degree_type` varchar(20)   DEFAULT '',
  `degree_level` varchar(5)   DEFAULT '',
  `degree_class` varchar(40)   DEFAULT '',
  `title` varchar(200)   DEFAULT '',
  `public_note` text,
  `semester_titles_csv` text,
  `catalog_year` int(11)   DEFAULT '2006',
  `exclude` int(11)   DEFAULT '0',
  `allow_dynamic` int(11)   DEFAULT '0',
  `advising_weight` int(11)   DEFAULT '0',  
  `override_degree_hours` varchar(20)   DEFAULT '',
  `min_tracks` int(11) DEFAULT '0',
  `max_tracks` int(11) DEFAULT '0',
  `default_tracks` varchar(255) DEFAULT '',  
  `track_selection_config` text,  
  PRIMARY KEY (`id`),
  KEY `degree_id` (`degree_id`),
  KEY `major_code` (`major_code`),
  KEY `degree_level` (`degree_level`),
  KEY `degree_class` (`degree_class`),
  KEY `allow_dynamic` (`allow_dynamic`),
  KEY `advising_weight` (`advising_weight`),
  KEY `catalog_year` (`catalog_year`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `draft_courses` (
  `id` int(11)   AUTO_INCREMENT,
  `course_id` int(11)   DEFAULT '0',
  `subject_id` varchar(10)   DEFAULT '',
  `course_num` varchar(10)   DEFAULT '',
  `catalog_year` int(11)   DEFAULT '2006',
  `title` text,
  `description` text,
  `min_hours` decimal(8,4)   DEFAULT '0.0000',
  `max_hours` decimal(8,4)   DEFAULT '0.0000',
  `repeat_hours` decimal(8,4)   DEFAULT '0.0000',
  `exclude` tinyint(4)   DEFAULT '0',
  `data_entry_comment` text,
  `delete_flag` tinyint(4)   DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `course_id` (`course_id`),
  KEY `subject_id` (`subject_id`),
  KEY `course_num` (`course_num`),
  KEY `catalog_year` (`catalog_year`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `draft_degree_requirements` (
  `id` int(11)   AUTO_INCREMENT,
  `degree_id` int(11)   DEFAULT '0',
  `semester_num` int(11)   DEFAULT '0',
  `group_id` int(11)   DEFAULT '0',
  `group_requirement_type` varchar(10)   DEFAULT '',
  `group_min_hours_allowed` decimal(8,4)   DEFAULT '0.0000',
  `group_hours_required` decimal(8,4)   DEFAULT '0.0000',
  `group_min_grade` varchar(10)   DEFAULT '',
  `course_id` int(11)   DEFAULT '0',
  `course_min_grade` varchar(10)   DEFAULT '',
  `course_requirement_type` varchar(10)   DEFAULT '',
  `data_entry_value` varchar(50)   DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `degree_id` (`degree_id`),
  KEY `group_id` (`group_id`),
  KEY `dev` (`data_entry_value`)
);";
  db_query($q);

  $q = "
CREATE TABLE `draft_degree_tracks` (
  `track_id` int(11)   AUTO_INCREMENT,
  `catalog_year` int(11)   DEFAULT '2006',
  `major_code` varchar(100)   DEFAULT '',
  `track_code` varchar(20)   DEFAULT '',
  `track_title` varchar(100)   DEFAULT '',
  `track_short_title` varchar(50)   DEFAULT '',
  `track_description` text,
  PRIMARY KEY (`track_id`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `draft_degrees` (
  `id` int(11)   AUTO_INCREMENT,
  `degree_id` int(11)   DEFAULT '0',
  `major_code` varchar(100)   DEFAULT '',
  `degree_type` varchar(20)   DEFAULT '',
  `degree_level` varchar(5)   DEFAULT '',
  `degree_class` varchar(40)   DEFAULT '',
  `title` varchar(200)   DEFAULT '',
  `public_note` text,
  `semester_titles_csv` text,
  `catalog_year` int(11)   DEFAULT '2006',
  `exclude` int(11)   DEFAULT '0',
  `allow_dynamic` int(11)   DEFAULT '0',
  `advising_weight` int(11)   DEFAULT '0',
  `override_degree_hours` varchar(20)   DEFAULT '',
  `min_tracks` int(11) DEFAULT '0',
  `max_tracks` int(11) DEFAULT '0',
  `default_tracks` varchar(255) DEFAULT '',  
  `track_selection_config` text,  
  PRIMARY KEY (`id`),
  KEY `degree_id` (`degree_id`),
  KEY `major_code` (`major_code`),
  KEY `exclude` (`exclude`),
  KEY `allow_dynamic` (`allow_dynamic`),
  KEY `advising_weight` (`advising_weight`),
  KEY `degree_level` (`degree_level`),
  KEY `degree_class` (`degree_class`),
  KEY `catalog_year` (`catalog_year`)  
);";
  db_query($q);

  $q = "
CREATE TABLE `draft_group_requirements` (
  `id` int(11)   AUTO_INCREMENT,
  `group_id` int(11)   DEFAULT '0',
  `course_id` int(11)   DEFAULT '0',
  `course_min_grade` varchar(10)   DEFAULT '',
  `course_repeats` int(11)   DEFAULT '0',
  `child_group_id` int(11)   DEFAULT '0',
  `data_entry_value` varchar(50)   DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `group_id` (`group_id`),
  KEY `dev` (`data_entry_value`)
); ";
  db_query($q);



  $q = "

CREATE TABLE `draft_groups` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `group_id` int(11) DEFAULT '0',
  `group_name` varchar(200) DEFAULT '',
  `title` varchar(255) DEFAULT '',
  `definition` text,
  `icon_filename` text,
  `catalog_year` int(11) DEFAULT '2006',
  `priority` int(11) DEFAULT '50',
  `delete_flag` tinyint(4) DEFAULT '0',
  `data_entry_comment` text,
  `catalog_repeat` tinyint(4) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `group_id` (`group_id`),
  KEY `group_name` (`group_name`),
  KEY `catalog_year` (`catalog_year`),
  KEY `title` (`title`),
  KEY `delete_flag` (`delete_flag`),
  KEY `catalog_repeat` (`catalog_repeat`),
  KEY `priority` (`priority`)
);    ";
  db_query($q);

  $q = "
CREATE TABLE `draft_instructions` (
  `id` int(11)   AUTO_INCREMENT,
  `instruction` text,
  PRIMARY KEY (`id`)
);";
  db_query($q);

  $q = "
CREATE TABLE `faculty` (
  `cwid` varchar(30)  ,
  `college` varchar(100)   DEFAULT '',
  `department_code` varchar(10)   DEFAULT '',
  `department` varchar(100)   DEFAULT '',  
  `major_code_csv` varchar(255)   DEFAULT '',
  PRIMARY KEY (`cwid`),
  KEY `major_code_csv` (`major_code_csv`),
  KEY `dept` (`department`),
  KEY `department_code` (`department_code`),
  KEY `college` (`college`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `group_requirements` (
  `id` int(11)   AUTO_INCREMENT,
  `group_id` int(11)   DEFAULT '0',
  `course_id` int(11)   DEFAULT '0',
  `course_min_grade` varchar(10)   DEFAULT '',
  `course_repeats` int(11)   DEFAULT '0',
  `child_group_id` int(11)   DEFAULT '0',
  `data_entry_value` varchar(50)   DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `group_id` (`group_id`),
  KEY `dev` (`data_entry_value`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `groups` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `group_id` int(11) DEFAULT '0',
  `group_name` varchar(200) DEFAULT '',
  `title` varchar(255) DEFAULT '',
  `definition` text,
  `icon_filename` text,
  `catalog_year` int(11) DEFAULT '2006',
  `priority` int(11) DEFAULT '50',
  `delete_flag` tinyint(4) DEFAULT '0',
  `data_entry_comment` text,
  `catalog_repeat` tinyint(4) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `group_id` (`group_id`),
  KEY `group_name` (`group_name`),
  KEY `catalog_year` (`catalog_year`),
  KEY `title` (`title`),
  KEY `delete_flag` (`delete_flag`),
  KEY `catalog_repeat` (`catalog_repeat`),
  KEY `priority` (`priority`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `menu_router` (
  `path` varchar(255)  ,
  `access_callback` varchar(255) DEFAULT '',
  `access_arguments` text,
  `page_callback` varchar(255) DEFAULT '',
  `page_arguments` text,
  `title` varchar(255) DEFAULT '',
  `description` text,
  `type` tinyint(3) unsigned DEFAULT '0',
  `tab_family` varchar(255) DEFAULT '',
  `tab_parent` varchar(255) DEFAULT '',
  `weight` int(11) DEFAULT '0',
  `icon` varchar(255) DEFAULT '',
  `page_settings` text,
  `file` varchar(255) DEFAULT '',
  PRIMARY KEY (`path`),
  KEY `type` (`type`),
  KEY `tab_family` (`tab_family`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `modules` (
  `path` varchar(255)  ,
  `name` varchar(100)   DEFAULT '',
  `version` varchar(20)   DEFAULT '',
  `requires` text,
  `enabled` int(11)   DEFAULT '0',
  `weight` int(11)   DEFAULT '0',
  `type` varchar(20)   DEFAULT '',
  `schema` int(11)   DEFAULT '0',
  `info` text,
  PRIMARY KEY (`path`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `role_permissions` (
  `pid` int(10) unsigned   AUTO_INCREMENT,
  `rid` int(10) unsigned   DEFAULT '0',
  `perm` varchar(255)   DEFAULT '',
  PRIMARY KEY (`pid`),
  KEY `perm` (`perm`),
  KEY `rid` (`rid`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `roles` (
  `rid` int(11)   AUTO_INCREMENT,
  `name` varchar(255)   DEFAULT '',
  PRIMARY KEY (`rid`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `standardized_tests` (
  `id` int(11)   AUTO_INCREMENT,
  `test_id` varchar(20)   DEFAULT '',
  `category_id` varchar(20)   DEFAULT '',
  `position` int(11)   DEFAULT '0',
  `test_description` varchar(200)   DEFAULT '',
  `category_description` varchar(200)   DEFAULT '',
  PRIMARY KEY (`id`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `student_courses` (
  `id` int(11)   AUTO_INCREMENT,
  `student_id` varchar(30)   DEFAULT '',
  `subject_id` varchar(10)   DEFAULT '',
  `course_num` varchar(10)   DEFAULT '',
  `hours_awarded` decimal(8,4)   DEFAULT '0.0000',
  `grade` varchar(5)   DEFAULT '',
  `term_id` varchar(20)   DEFAULT '',
  `level_code` varchar(10)   DEFAULT '',
  PRIMARY KEY  (`id`),
  KEY `student_id` (`student_id`),
  KEY `level_code` (`level_code`)
); ";
  db_query($q);



  $q = "
CREATE TABLE `student_degrees` (
  `student_id` varchar(30)   DEFAULT '',
  `major_code` varchar(100)   DEFAULT '',
  `is_editable` tinyint(4)   DEFAULT '0',
  `delete_flag` tinyint(4)   DEFAULT '0',
  PRIMARY KEY (`student_id`,`major_code`)
);  ";
  db_query($q);


  $q = "
CREATE TABLE `student_developmentals` (
  `student_id` varchar(30)  ,
  `requirement` varchar(15)   DEFAULT '',
  PRIMARY KEY (`student_id`,`requirement`),
  KEY (`requirement`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `student_settings` (
  `student_id` varchar(30)  ,
  `settings` text,
  `posted` int(10) unsigned   DEFAULT '0',
  PRIMARY KEY (`student_id`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `student_substitutions` (
  `id` int(11)   AUTO_INCREMENT,
  `student_id` varchar(30)   DEFAULT '',
  `faculty_id` varchar(30)   DEFAULT '',
  `required_course_id` int(11)   DEFAULT '0',
  `required_entry_value` varchar(20)   DEFAULT '',
  `required_group_id` varchar(50)   DEFAULT '',
  `required_degree_id` int(11) unsigned   DEFAULT '0',
  `required_semester_num` int(11)   DEFAULT '0',
  `sub_course_id` int(11)   DEFAULT '0',
  `sub_entry_value` varchar(20)   DEFAULT '',
  `sub_term_id` varchar(20)   DEFAULT '',
  `sub_transfer_flag` tinyint(4)   DEFAULT '0',
  `sub_hours` decimal(8,4)   DEFAULT '0.0000',
  `sub_remarks` text,
  `posted` int(10) unsigned   DEFAULT '0',
  `delete_flag` tinyint(4)   DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `student_id` (`student_id`),
  KEY `rev` (`required_entry_value`),
  KEY `sev` (`sub_entry_value`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `student_tests` (
  `id` int(11)   AUTO_INCREMENT,
  `student_id` varchar(30)   DEFAULT '',
  `test_id` varchar(20)   DEFAULT '',
  `category_id` varchar(20)   DEFAULT '',
  `score` varchar(10)   DEFAULT '',
  `date_taken` datetime   DEFAULT '1970-01-01 00:00:01',
  PRIMARY KEY (`id`),
  KEY `student_id` (`student_id`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `student_transfer_courses` (
  `id` int(10) unsigned   AUTO_INCREMENT,
  `student_id` varchar(30)   DEFAULT '',
  `transfer_course_id` int(11)   DEFAULT '0',
  `student_specific_course_title` varchar(255)   DEFAULT '',
  `term_id` varchar(20)   DEFAULT '',
  `grade` varchar(5)   DEFAULT '',
  `hours_awarded` decimal(8,4)   DEFAULT '0.0000',
  `level_code` VARCHAR(10)   DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `student_id` (`student_id`),
  KEY `transfer_id` (`transfer_course_id`),
  KEY `term_id` (`term_id`),
  KEY `grade` (`grade`),
  KEY `level_code` (`level_code`),
  KEY `hrs` (`hours_awarded`)
) ; ";
  db_query($q);

  $q = "
CREATE TABLE `student_unassign_group` (
  `id` int(11)   AUTO_INCREMENT,
  `student_id` varchar(30)   DEFAULT '',
  `faculty_id` varchar(30)   DEFAULT '',
  `course_id` int(11)   DEFAULT '0',
  `term_id` varchar(20)   DEFAULT '',
  `transfer_flag` tinyint(4)   DEFAULT '0',
  `group_id` varchar(50)   DEFAULT '',
  `degree_id` int(11)   DEFAULT '0',
  `delete_flag` tinyint(4)   DEFAULT '0',
  `posted` int(10) unsigned   DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY (`student_id`),
  KEY (`faculty_id`),
  KEY (`delete_flag`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `student_unassign_transfer_eqv` (
  `id` int(11)   AUTO_INCREMENT,
  `student_id` varchar(30)   DEFAULT '',
  `faculty_id` varchar(30)   DEFAULT '',
  `transfer_course_id` int(11)   DEFAULT '0',
  `delete_flag` tinyint(4)   DEFAULT '0',
  `posted` int(10) unsigned   DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY (`student_id`),
  KEY (`faculty_id`),
  KEY (`transfer_course_id`),
  KEY (`delete_flag`)  
); ";
  db_query($q);

  $q = "
CREATE TABLE `students` (
  `cwid` varchar(30)  ,
  `cumulative_hours` varchar(20)   DEFAULT '',
  `gpa` varchar(20)   DEFAULT '',
  `rank_code` varchar(20)   DEFAULT '',  
  `catalog_year` int(11)   DEFAULT '2006',
  `is_active` tinyint(11)   DEFAULT '0',
  PRIMARY KEY (`cwid`),
  KEY `rank_code` (`rank_code`),
  KEY `is_active` (`is_active`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `subjects` (
  `subject_id` varchar(10)  ,
  `college` varchar(10)   DEFAULT '',
  `title` varchar(255)   DEFAULT '',
  PRIMARY KEY (`subject_id`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `transfer_courses` (
  `transfer_course_id` int(11)   AUTO_INCREMENT,
  `institution_id` varchar(10)   DEFAULT '',
  `subject_id` varchar(10)   DEFAULT '',
  `course_num` varchar(10)   DEFAULT '',
  `title` varchar(100)   DEFAULT '',
  `description` text,
  `min_hours` decimal(8,4)   DEFAULT '0.0000',
  `max_hours` decimal(8,4)   DEFAULT '0.0000',
  PRIMARY KEY (`transfer_course_id`),
  KEY `ic` (`institution_id`),
  KEY `si` (`subject_id`),
  KEY `cn` (`course_num`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `transfer_eqv_per_student` (
  `id` int(11)   AUTO_INCREMENT,
  `student_id` varchar(30)   DEFAULT '',
  `transfer_course_id` int(11)   DEFAULT '0',
  `local_course_id` int(11)   DEFAULT '0',
  `valid_term_id` varchar(20)   DEFAULT '',
  `broken_id` int(11)   DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `student_id` (`student_id`),
  KEY `transfer_course_id` (`transfer_course_id`),
  KEY `local_course_id` (`local_course_id`),
  KEY `broken_id` (`broken_id`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `transfer_institutions` (
  `institution_id` varchar(10)  ,
  `name` varchar(200)   DEFAULT '',
  `state` varchar(10)   DEFAULT '',
  PRIMARY KEY (`institution_id`),
  KEY `state` (`state`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `user_roles` (
  `user_id` int(11)  ,
  `rid` int(11)   DEFAULT '0',
  PRIMARY KEY (`user_id`,`rid`),
  KEY (`rid`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `user_settings` (
  `user_id` int(11)  ,
  `settings` text,
  `posted` int(10) unsigned   DEFAULT '0',
  PRIMARY KEY (`user_id`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `users` (
  `user_id` int(11)   AUTO_INCREMENT,
  `user_name` varchar(50)   DEFAULT '',
  `password` varchar(255)   DEFAULT '',
  `is_student` tinyint(4)   DEFAULT '0',
  `is_faculty` tinyint(4)   DEFAULT '0',
  `email` varchar(255)   DEFAULT '',
  `cwid` varchar(30)   DEFAULT '',
  `f_name` varchar(100)   DEFAULT '',
  `l_name` varchar(100)   DEFAULT '',
  `is_disabled` tinyint(4)   DEFAULT '0',
 PRIMARY KEY  (`user_id`),
 KEY `cwid` (`cwid`),
 KEY `user_name` (`user_name`),
 KEY (`is_disabled`),
 KEY (`is_faculty`),
 KEY (`is_student`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `variables` (
  `name` varchar(255)  ,
  `value` text,
  PRIMARY KEY (`name`)
); ";
  db_query($q);

  $q = "
CREATE TABLE `watchdog` (
  `wid` int(11) unsigned   AUTO_INCREMENT,
  `user_id` int(11) unsigned   DEFAULT '0',
  `user_name` varchar(50)   DEFAULT '',
  `cwid` varchar(30)   DEFAULT '',
  `type` varchar(100)   DEFAULT '',
  `message` text,
  `variables` text,
  `severity` tinyint(3) unsigned  DEFAULT '0',
  `extra_data` varchar(255) DEFAULT '',
  `location` text,
  `referer` text,
  `ip` varchar(64)   DEFAULT '',
  `is_mobile` tinyint(4) DEFAULT '0',
  `is_student` tinyint(4) DEFAULT '0',
  `is_faculty` tinyint(4) DEFAULT '0',
  `timestamp` int(11) unsigned DEFAULT '0',
  PRIMARY KEY (`wid`),
  KEY `type` (`type`),
  KEY `uid` (`user_id`),
  KEY `uname` (`user_name`),
  KEY `severity` (`severity`),
  KEY `cwid` (`cwid`)
); ";

  db_query($q);


}