system.install
Search API
- 7.x modules/system/system.install
- 6.x modules/system/system.install
- 4.x modules/system/system.install
- 5.x modules/system/system.install
The install file for the System module
This file is responsible for installing all of the required tables for FlightPath.
File
modules/system/system.installView source
- <?php
- /**
- * @file
- * The install file for the System module
- *
- * This file is responsible for installing all of the required tables
- * for FlightPath.
- */
-
-
-
- /**
- * Implementation of hook_enable.
- *
- * This is meant to be called during initial installation. We will make all of the
- * database changes we need to make in order to have FlightPath up and running.
- */
- function system_enable() {
-
- // Set up our default roles
- db_query("INSERT INTO roles (rid, name)
- VALUES (1, 'anonymous user'),
- (2, 'authenticated user')");
-
- // Add in the anonymous user into the users table (uid = 0)
- db_query("INSERT INTO users (user_id, cwid, user_name) VALUES (0, 0, 'anonymous')");
-
- // Let's figure out what the current schema value is for this system module...
- $info_contents = file_get_contents("modules/system/system.info");
- // From the info_contents variable, split up and place into an array.
- $info_details_array = array();
- $lines = explode("\n", $info_contents);
- foreach ($lines as $line) {
- if (trim($line) == "") continue;
- $temp = explode("=", trim($line));
- $info_details_array[trim($temp[0])] = trim(substr($line, strlen($temp[0]) + 1));
- }
-
- // Set up the modules table-- add the system module first.
- db_query("INSERT INTO modules (path, name, version, enabled, weight, type, `schema`)
- VALUES ('modules/system', 'system', 'core', 1, '-999', 'module', '?') ", $info_details_array["schema"]);
-
-
- // Let's perform installations on the other modules we want enabled by default.
- $modules = array("admin", "advise", "blocks", "comments", "student_search", "update_status", "content", "announcements", "tinymce", "course_search", "blank_degrees", "user", "batch");
- foreach ($modules as $module) {
- system_enable_module(array("module" => $module, "path" => "modules/$module", "version" => "core"));
- }
-
- // Set up some blocks for the system module by default.
- db_query("INSERT INTO blocks (section, region, module, delta, weight)
- VALUES ('system_main', 'right_col', 'system', 'tools', 1),
- ('system_main', 'right_col', 'system', 'admin_tools', 2),
- ('system_main', 'left_col', 'announcements', 'primary', 0),
- ('system_login', 'left_col', 'blocks', 'block_1', 0),
- ('system_login', 'right_col', 'system', 'login_form', 0),
- ('system_login', 'top', 'blocks', 'block_2', 0)
-
- ");
-
-
- // Set up some basic permissions for authenticated user.
- db_query("INSERT INTO role_permissions (rid, perm)
- VALUES
- (2, 'access_logged_in_content'),
- (2, 'view_comments') ");
-
-
- // Add some default variable values, to make things a little easier on first-run.
- variable_set("earliest_catalog_year", date("Y"));
- variable_set("current_catalog_year", date("Y"));
- variable_set("current_draft_catalog_year", date("Y"));
-
-
- // Do we have "clean URLs" enabled?
- $test = system_check_clean_urls();
- variable_set("clean_urls", $test);
-
- }
-
-
-
- function system_update($old_schema, $new_schema) {
- if ($old_schema <= 1) {
- // Add column to the faculty table
- db_query("ALTER TABLE faculty
- ADD COLUMN department_code varchar(10) AFTER college,
- ADD INDEX (department_code)");
- }
-
-
- if ($old_schema < 3) {
- // Add an index to the advising_comments table for access_type
- db_query("ALTER TABLE advising_comments
- ADD INDEX (access_type) ");
- }
-
-
- if ($old_schema < 4) {
- // Add college-related tables
- db_query("CREATE TABLE `colleges` (
- `college_code` varchar(10) ,
- `title` varchar(255) ,
- PRIMARY KEY (`college_code`)
- ) ");
-
- db_query("CREATE TABLE `degree_college` (
- `major_code` varchar(100) ,
- `college_code` varchar(10) ,
- PRIMARY KEY (`major_code`),
- KEY `college_code` (`college_code`)
- ) ");
-
- fp_add_message(t("Added college-related tables to database."));
- }
-
- if ($old_schema < 5) {
- // Update hour fields to be decimal type.
- db_query("ALTER TABLE `advised_courses` MODIFY `var_hours` DECIMAL(8,4) ");
- db_query("ALTER TABLE `student_courses` MODIFY `hours_awarded` DECIMAL(8,4) ");
- db_query("ALTER TABLE `student_substitutions` MODIFY `sub_hours` DECIMAL(8,4) ");
-
- db_query("ALTER TABLE `courses` MODIFY `min_hours` DECIMAL(8,4) ");
- db_query("ALTER TABLE `courses` MODIFY `max_hours` DECIMAL(8,4) ");
- db_query("ALTER TABLE `courses` MODIFY `repeat_hours` DECIMAL(8,4) ");
- db_query("ALTER TABLE `draft_courses` MODIFY `min_hours` DECIMAL(8,4) ");
- db_query("ALTER TABLE `draft_courses` MODIFY `max_hours` DECIMAL(8,4) ");
- db_query("ALTER TABLE `draft_courses` MODIFY `repeat_hours` DECIMAL(8,4) ");
-
- db_query("ALTER TABLE `degree_requirements` MODIFY `group_hours_required` DECIMAL(8,4) ");
- db_query("ALTER TABLE `draft_degree_requirements` MODIFY `group_hours_required` DECIMAL(8,4) ");
-
- db_query("ALTER TABLE `student_transfer_courses` MODIFY `hours_awarded` DECIMAL(8,4) ");
- db_query("ALTER TABLE `transfer_courses` MODIFY `min_hours` DECIMAL(8,4) ");
- db_query("ALTER TABLE `transfer_courses` MODIFY `max_hours` DECIMAL(8,4) ");
-
-
- // Also, expand the varchar fields for students table...
- db_query("ALTER TABLE `students` MODIFY `cumulative_hours` varchar(10) ");
- db_query("ALTER TABLE `students` MODIFY `gpa` varchar(10) ");
-
-
- fp_add_message(t("Updated database fields to allow for decimal hours."));
- }
-
-
- if ($old_schema < 6) {
- // Add level_code field to relavant tables.
- db_query("alter table `student_courses` add column `level_code` VARCHAR(10) ");
- db_query("alter table `student_transfer_courses` add column `level_code` VARCHAR(10) ");
-
- // Also add indexes for these fields.
- db_query("alter table `student_courses` add index `level_code` (level_code)");
- db_query("alter table `student_transfer_courses` add index `level_code` (level_code)");
-
-
- fp_add_message(t("Updated database fields to allow for level codes per course."));
- }
-
-
-
- if ($old_schema < 8) {
- // We want to add an "extra_data" field to the student_degrees table. This is an optional field, meant to be
- // used by module developers. It can be empty, and will not affect the core functioning of FlightPath.
- db_query("alter table `student_degrees` add column `extra_data` VARCHAR(255) ");
-
- // Add an index as well...
- db_query("alter table `student_degrees` add index `extra_data` (extra_data)");
-
- }
-
-
-
-
- }
-
-
-
- /**
- * Implementation of hook_install.
- *
- * This will create all of our tables.
- */
- 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);
-
-
- }
Functions
Name | Description |
---|---|
system_enable | Implementation of hook_enable. |
system_install | Implementation of hook_install. |
system_update |