system.install

  1. 7.x modules/system/system.install
  2. 6.x modules/system/system.install
  3. 4.x modules/system/system.install
  4. 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.install
View source
  1. <?php
  2. /**
  3. * @file
  4. * The install file for the System module
  5. *
  6. * This file is responsible for installing all of the required tables
  7. * for FlightPath.
  8. */
  9. /**
  10. * Implementation of hook_enable.
  11. *
  12. * This is meant to be called during initial installation. We will make all of the
  13. * database changes we need to make in order to have FlightPath up and running.
  14. */
  15. function system_enable() {
  16. // Set up our default roles
  17. db_query("INSERT INTO roles (rid, name)
  18. VALUES (1, 'anonymous user'),
  19. (2, 'authenticated user')");
  20. // Add in the anonymous user into the users table (uid = 0)
  21. db_query("INSERT INTO users (user_id, cwid, user_name) VALUES (0, 0, 'anonymous')");
  22. // Let's figure out what the current schema value is for this system module...
  23. $info_contents = file_get_contents("modules/system/system.info");
  24. // From the info_contents variable, split up and place into an array.
  25. $info_details_array = array();
  26. $lines = explode("\n", $info_contents);
  27. foreach ($lines as $line) {
  28. if (trim($line) == "") continue;
  29. $temp = explode("=", trim($line));
  30. $info_details_array[trim($temp[0])] = trim(substr($line, strlen($temp[0]) + 1));
  31. }
  32. // Set up the modules table-- add the system module first.
  33. db_query("INSERT INTO modules (`path`, `name`, `version`, `enabled`, `weight`, `type`, `schema`)
  34. VALUES ('modules/system', 'system', 'core', 1, '-999', 'module', '?') ", $info_details_array["schema"]);
  35. // Let's perform installations on the other modules we want enabled by default.
  36. $modules = array("admin", "advise", "comments", "student_search", "update_status", "content", "announcements", "tinymce", "course_search", "blank_degrees", "user",
  37. "batch", 'stats', 'smtp', 'prereqs', 'lassie', 'calendar', 'alerts', 'audit', 'engagements', 'notify', 'student_files', 'encryption',
  38. 'student_priority', 'student_profile', 'masquerade');
  39. foreach ($modules as $module) {
  40. $info_contents = file_get_contents("modules/$module/$module.info");
  41. // From the info_contents variable, split up and place into an array.
  42. $info_details_array = array();
  43. $lines = explode("\n", $info_contents);
  44. foreach ($lines as $line) {
  45. if (trim($line) == "") continue;
  46. $temp = explode("=", trim($line));
  47. $info_details_array[trim($temp[0])] = trim(substr($line, strlen($temp[0]) + 1));
  48. }
  49. $schema = 0;
  50. if (isset($info_details_array['schema'])) $schema = $info_details_array['schema'];
  51. system_enable_module(array("module" => $module, "path" => "modules/$module", "version" => "core", "schema" => $schema));
  52. }
  53. /*
  54. // Set up some blocks for the system module by default.
  55. db_query("INSERT INTO blocks (section, region, module, delta, weight)
  56. VALUES ('system_main', 'right_col', 'system', 'tools', 1),
  57. ('system_main', 'right_col', 'system', 'admin_tools', 2),
  58. ('system_main', 'left_col', 'announcements', 'primary', 0),
  59. ('system_login', 'left_col', 'blocks', 'block_1', 0),
  60. ('system_login', 'right_col', 'system', 'login_form', 0),
  61. ('system_login', 'top', 'blocks', 'block_2', 0)
  62. ");
  63. */
  64. // Set up some basic permissions for authenticated user.
  65. db_query("INSERT INTO role_permissions (rid, perm)
  66. VALUES
  67. (2, 'access_logged_in_content'),
  68. (2, 'view_comments') ");
  69. // Add some default variable values, to make things a little easier on first-run.
  70. variable_set("earliest_catalog_year", date("Y"));
  71. variable_set("current_catalog_year", date("Y"));
  72. variable_set("current_draft_catalog_year", date("Y"));
  73. // Do we have "clean URLs" enabled?
  74. $test = system_check_clean_urls();
  75. variable_set("clean_urls", $test);
  76. }
  77. function system_update($old_schema, $new_schema) {
  78. if (intval($old_schema) < 2) {
  79. // We need to make the "watchdog.message" field a longtext instead of just "text".
  80. db_query("ALTER TABLE watchdog MODIFY message LONGTEXT");
  81. fpm("Altered watchdog table to change 'message' to LONGTEXT.");
  82. }
  83. if (intval($old_schema) < 3) {
  84. db_query("ALTER TABLE advising_comments MODIFY `comment` LONGTEXT");
  85. db_query("ALTER TABLE courses MODIFY `title` LONGTEXT,
  86. MODIFY `description` LONGTEXT,
  87. MODIFY `data_entry_comment` LONGTEXT");
  88. db_query("ALTER TABLE draft_courses MODIFY `title` LONGTEXT,
  89. MODIFY `description` LONGTEXT,
  90. MODIFY `data_entry_comment` LONGTEXT");
  91. db_query("ALTER TABLE degree_tracks MODIFY `track_description` LONGTEXT");
  92. db_query("ALTER TABLE draft_degree_tracks MODIFY `track_description` LONGTEXT");
  93. db_query("ALTER TABLE degrees MODIFY `public_note` LONGTEXT,
  94. MODIFY `semester_titles_csv` LONGTEXT,
  95. MODIFY `track_selection_config` LONGTEXT");
  96. db_query("ALTER TABLE draft_degrees MODIFY `public_note` LONGTEXT,
  97. MODIFY `semester_titles_csv` LONGTEXT,
  98. MODIFY `track_selection_config` LONGTEXT");
  99. db_query("ALTER TABLE `groups` MODIFY `public_note` LONGTEXT,
  100. MODIFY `definition` LONGTEXT,
  101. MODIFY `icon_filename` LONGTEXT,
  102. MODIFY `data_entry_comment` LONGTEXT");
  103. db_query("ALTER TABLE draft_groups MODIFY `public_note` LONGTEXT,
  104. MODIFY `definition` LONGTEXT,
  105. MODIFY `icon_filename` LONGTEXT,
  106. MODIFY `data_entry_comment` LONGTEXT");
  107. db_query("ALTER TABLE draft_instructions MODIFY `instruction` LONGTEXT");
  108. db_query("ALTER TABLE `variables` MODIFY `value` LONGTEXT");
  109. db_query("ALTER TABLE `student_priority` MODIFY `results` LONGTEXT");
  110. db_query("ALTER TABLE `user_attributes` MODIFY `value` LONGTEXT");
  111. db_query("ALTER TABLE `user_settings` MODIFY `value` LONGTEXT");
  112. db_query("ALTER TABLE `transfer_courses` MODIFY `description` LONGTEXT");
  113. db_query("ALTER TABLE student_settings MODIFY `settings` LONGTEXT");
  114. db_query("ALTER TABLE student_substitutions MODIFY `sub_remarks` LONGTEXT");
  115. db_query("ALTER TABLE menu_router MODIFY `access_arguments` LONGTEXT,
  116. MODIFY `page_arguments` LONGTEXT,
  117. MODIFY `description` LONGTEXT,
  118. MODIFY `page_settings` LONGTEXT");
  119. db_query("ALTER TABLE modules MODIFY `requires` LONGTEXT,
  120. MODIFY `info` LONGTEXT");
  121. db_query("ALTER TABLE watchdog MODIFY `variables` LONGTEXT,
  122. MODIFY `location` LONGTEXT,
  123. MODIFY `referer` LONGTEXT");
  124. fpm("Altered various system tables to change TEXT to LONGTEXT.");
  125. }
  126. if (intval($old_schema) < 4) {
  127. // We want to add the concept of a "advising_session_token" to the advising_sessions table.
  128. db_query("ALTER TABLE advising_sessions ADD COLUMN `advising_session_token` varchar(255) ");
  129. db_query("ALTER TABLE advising_sessions ADD INDEX (`advising_session_token`) ");
  130. // Assign a unique advising session "token" to every advising session/group of sessions saved at the same time.
  131. $res = db_query("SELECT distinct(posted), student_id FROM advising_sessions");
  132. while ($cur = db_fetch_array($res)) {
  133. $p = $cur['posted'];
  134. $student_id = $cur['student_id'];
  135. $token = sha1(mt_rand(0, 99999) . $p . $student_id);
  136. db_query("UPDATE advising_sessions SET advising_session_token = ? WHERE posted = ? AND student_id = ?", array($token, $p, $student_id));
  137. }
  138. } // schema 4
  139. if (intval($old_schema) < 5) {
  140. // Add "delete_flag" to advising_sessions table, and a key for it as well.
  141. db_query("ALTER TABLE advising_sessions ADD COLUMN `delete_flag` tinyint(4) DEFAULT 0 ");
  142. db_query("ALTER TABLE advising_sessions ADD INDEX (`delete_flag`) ");
  143. } // schema 5
  144. if (intval($old_schema) < 6) {
  145. // Add extra indexes to watchdog table for easier reporting.
  146. db_query("ALTER TABLE `watchdog` ADD INDEX (`timestamp`) ");
  147. db_query("ALTER TABLE `watchdog` ADD INDEX (`is_student`) ");
  148. db_query("ALTER TABLE `watchdog` ADD INDEX (`is_faculty`) ");
  149. }
  150. if (intval($old_schema) < 7) {
  151. // Add extra index to tables...
  152. db_query("ALTER TABLE `advising_sessions` ADD INDEX (`is_empty`) ");
  153. db_query("ALTER TABLE `advising_sessions` ADD INDEX (`posted`) ");
  154. db_query("ALTER TABLE `advising_sessions` ADD INDEX (`faculty_id`) ");
  155. db_query("ALTER TABLE `advising_sessions` ADD INDEX (`catalog_year`) ");
  156. db_query("ALTER TABLE `advising_sessions` ADD INDEX (`is_draft`) ");
  157. db_query("ALTER TABLE `advising_sessions` ADD INDEX (`is_whatif`) ");
  158. db_query("ALTER TABLE `advising_comments` ADD INDEX (`faculty_id`) ");
  159. db_query("ALTER TABLE `advising_comments` ADD INDEX (`posted`) ");
  160. db_query("ALTER TABLE `advising_comments` ADD INDEX (`term_id`) ");
  161. }
  162. if (intval($old_schema) < 8) {
  163. db_query("ALTER TABLE advising_sessions ADD COLUMN `most_recent_session` tinyint(4) DEFAULT 0 ");
  164. db_query("ALTER TABLE `advising_sessions` ADD INDEX (`most_recent_session`) ");
  165. }
  166. if (intval($old_schema) < 9) {
  167. db_query("ALTER TABLE student_courses ADD COLUMN `course_id` int(11) DEFAULT 0 ");
  168. db_query("ALTER TABLE `student_courses` ADD INDEX (`course_id`) ");
  169. }
  170. if (intval($old_schema) < 10) {
  171. db_query("ALTER TABLE `courses` ADD INDEX (`exclude`) ");
  172. db_query("ALTER TABLE `courses` ADD INDEX (`delete_flag`) ");
  173. db_query("ALTER TABLE `draft_courses` ADD INDEX (`exclude`) ");
  174. db_query("ALTER TABLE `draft_courses` ADD INDEX (`delete_flag`) ");
  175. }
  176. if (intval($old_schema) < 11) {
  177. $dept_val = "";
  178. $res = db_query("SELECT * FROM faculty
  179. GROUP BY department_code
  180. ORDER BY department");
  181. while ($cur = db_fetch_array($res)) {
  182. $key = trim($cur["department_code"]);
  183. $value = trim($cur["department"]);
  184. if ($key == "") {
  185. $key = "UNSPECIFIED";
  186. }
  187. //$dept_options[$key] = $dispval;
  188. $dept_val .= $key . " ~ " . $value . "\n";
  189. }
  190. variable_set('departments', $dept_val);
  191. }
  192. if (intval($old_schema) < 12) {
  193. // Adding indexs to student_degrees table.
  194. db_query("ALTER TABLE `student_degrees` ADD INDEX (`major_code`) ");
  195. db_query("ALTER TABLE `student_degrees` ADD INDEX (`delete_flag`) ");
  196. // Remove "department" column from faculty table.
  197. db_query("ALTER TABLE faculty DROP COLUMN `department`");
  198. }
  199. } // update
  200. /**
  201. * Implementation of hook_install.
  202. *
  203. * This will create all of our tables.
  204. */
  205. function system_install() {
  206. // Since this will ONLY be called during initial install, we do not
  207. // need to first check for existing tables; it is assumed that the database
  208. // is empty.
  209. // Therefore, let's place all of our create table statements in one query, for
  210. // simplicity.
  211. $q = "
  212. CREATE TABLE `advised_courses` (
  213. `id` int(11) NOT NULL AUTO_INCREMENT,
  214. `advising_session_id` int(11) DEFAULT '0',
  215. `course_id` int(11) DEFAULT '0',
  216. `entry_value` varchar(20) DEFAULT '',
  217. `semester_num` int(11) DEFAULT '0',
  218. `group_id` varchar(50) DEFAULT '',
  219. `var_hours` decimal(8,4) DEFAULT '0.0000',
  220. `term_id` varchar(20) DEFAULT '',
  221. `degree_id` int(11) DEFAULT '0',
  222. PRIMARY KEY (`id`),
  223. KEY `advid` (`advising_session_id`),
  224. KEY `course_id` (`course_id`),
  225. KEY `ev` (`entry_value`),
  226. KEY `degree_id` (`degree_id`),
  227. KEY `term_id` (`term_id`),
  228. KEY `semester_num` (`semester_num`)
  229. ); ";
  230. db_query($q);
  231. $q = "
  232. CREATE TABLE `advising_comments` (
  233. `id` int(11) NOT NULL AUTO_INCREMENT,
  234. `student_id` varchar(30) DEFAULT '0',
  235. `faculty_id` varchar(30) DEFAULT '0',
  236. `term_id` varchar(20) DEFAULT '',
  237. `comment` longtext DEFAULT NULL,
  238. `posted` int(10) unsigned DEFAULT 0,
  239. `access_type` varchar(20) DEFAULT '',
  240. `delete_flag` tinyint(4) DEFAULT 0,
  241. PRIMARY KEY (`id`),
  242. KEY `student_id` (`student_id`),
  243. KEY `faculty_id` (`faculty_id`),
  244. KEY `posted` (`posted`),
  245. KEY `term_id` (`term_id`),
  246. KEY `delete_flag` (`delete_flag`),
  247. KEY `access_type` (`access_type`)
  248. );
  249. ";
  250. db_query($q);
  251. $q = "
  252. CREATE TABLE `advising_sessions` (
  253. `advising_session_id` int(11) NOT NULL AUTO_INCREMENT,
  254. `student_id` varchar(30) DEFAULT '0',
  255. `faculty_id` varchar(30) DEFAULT '0',
  256. `term_id` varchar(20) DEFAULT '',
  257. `degree_id` int(11) DEFAULT 0,
  258. `major_code_csv` varchar(255) DEFAULT '',
  259. `catalog_year` int(11) DEFAULT 0,
  260. `posted` int(10) unsigned DEFAULT 0,
  261. `is_whatif` tinyint(4) DEFAULT 0,
  262. `is_draft` tinyint(4) DEFAULT 0,
  263. `is_empty` tinyint(4) DEFAULT 0,
  264. `advising_session_token` varchar(255) DEFAULT NULL,
  265. `delete_flag` tinyint(4) DEFAULT 0,
  266. `most_recent_session` tinyint(4) DEFAULT 0,
  267. PRIMARY KEY (`advising_session_id`),
  268. KEY `sid` (`student_id`),
  269. KEY `termid` (`term_id`),
  270. KEY `is_empty` (`is_empty`),
  271. KEY `posted` (`posted`),
  272. KEY `faculty_id` (`faculty_id`),
  273. KEY `catalog_year` (`catalog_year`),
  274. KEY `is_draft` (`is_draft`),
  275. KEY `is_whatif` (`is_whatif`),
  276. KEY `delete_flag` (`delete_flag`),
  277. KEY `most_recent_session` (`most_recent_session`),
  278. KEY `advising_session_token` (`advising_session_token`)
  279. ); ";
  280. db_query($q);
  281. $q = "
  282. CREATE TABLE `advisor_student` (
  283. `faculty_id` varchar(30) NOT NULL DEFAULT '0',
  284. `student_id` varchar(30) NOT NULL DEFAULT '0',
  285. PRIMARY KEY (`faculty_id`,`student_id`)
  286. ); ";
  287. db_query($q);
  288. /*
  289. $q = "
  290. CREATE TABLE `blocks` (
  291. `bid` int(10) unsigned AUTO_INCREMENT,
  292. `section` varchar(255) DEFAULT '',
  293. `region` varchar(255) DEFAULT '',
  294. `module` varchar(255) DEFAULT '',
  295. `delta` varchar(255) DEFAULT '',
  296. `weight` int(11) DEFAULT '0',
  297. PRIMARY KEY (`bid`)
  298. ); ";
  299. db_query($q);
  300. *
  301. */
  302. $q = "
  303. CREATE TABLE `courses` (
  304. `id` int(11) NOT NULL AUTO_INCREMENT,
  305. `course_id` int(11) DEFAULT 0,
  306. `subject_id` varchar(10) DEFAULT '',
  307. `course_num` varchar(10) DEFAULT '',
  308. `catalog_year` int(11) DEFAULT 0,
  309. `title` longtext DEFAULT NULL,
  310. `description` longtext DEFAULT NULL,
  311. `min_hours` decimal(8,4) DEFAULT 0.0000,
  312. `max_hours` decimal(8,4) DEFAULT 0.0000,
  313. `repeat_hours` decimal(8,4) DEFAULT 0.0000,
  314. `exclude` tinyint(4) DEFAULT 0,
  315. `data_entry_comment` longtext DEFAULT NULL,
  316. `delete_flag` tinyint(4) DEFAULT 0,
  317. `school_id` int(11) NOT NULL DEFAULT 0,
  318. PRIMARY KEY (`id`) ,
  319. KEY `course_id` (`course_id`) ,
  320. KEY `subject_id` (`subject_id`) ,
  321. KEY `course_num` (`course_num`) ,
  322. KEY `delete_flag` (`delete_flag`) ,
  323. KEY `exclude` (`exclude`) ,
  324. KEY `catalog_year` (`catalog_year`) ,
  325. KEY `school_id` (`school_id`),
  326. KEY `catalog_year_2` (`catalog_year`,`exclude`,`school_id`,`delete_flag`),
  327. KEY `course_num_2` (`course_num`,`catalog_year`,`exclude`,`delete_flag`,`school_id`),
  328. KEY `catalog_year_3` (`catalog_year`,`exclude`,`delete_flag`)
  329. ); ";
  330. db_query($q);
  331. db_query("CREATE TABLE `colleges` (
  332. `college_code` varchar(10) NOT NULL,
  333. `title` varchar(255) DEFAULT '',
  334. `school_id` int(11) NOT NULL DEFAULT 0,
  335. PRIMARY KEY (`college_code`,`school_id`),
  336. KEY `school_id` (`school_id`)
  337. ); ");
  338. db_query("CREATE TABLE `degree_college` (
  339. `major_code` varchar(100) NOT NULL DEFAULT '',
  340. `college_code` varchar(10) DEFAULT '',
  341. `school_id` int(11) NOT NULL DEFAULT 0,
  342. PRIMARY KEY (`major_code`,`school_id`),
  343. KEY `college_code` (`college_code`),
  344. KEY `school_id` (`school_id`)
  345. ); ");
  346. $q = "
  347. CREATE TABLE `degree_requirements` (
  348. `id` int(11) AUTO_INCREMENT,
  349. `degree_id` int(11) DEFAULT '0',
  350. `semester_num` int(11) DEFAULT '0',
  351. `group_id` int(11) DEFAULT '0',
  352. `group_requirement_type` varchar(10) DEFAULT '',
  353. `group_min_hours_allowed` decimal(8,4) DEFAULT '0.0000',
  354. `group_hours_required` decimal(8,4) DEFAULT '0.0000',
  355. `group_min_grade` varchar(10) DEFAULT '',
  356. `course_id` int(11) DEFAULT '0',
  357. `course_min_grade` varchar(10) DEFAULT '',
  358. `course_requirement_type` varchar(10) DEFAULT '',
  359. `data_entry_value` varchar(50) DEFAULT '',
  360. PRIMARY KEY (`id`),
  361. KEY `degree_id` (`degree_id`),
  362. KEY `group_id` (`group_id`),
  363. KEY `dev` (`data_entry_value`)
  364. ); ";
  365. db_query($q);
  366. $q = "
  367. CREATE TABLE `degree_tracks` (
  368. `track_id` int(11) NOT NULL AUTO_INCREMENT,
  369. `catalog_year` int(11) DEFAULT 2006,
  370. `major_code` varchar(100) DEFAULT '',
  371. `track_code` varchar(20) DEFAULT '',
  372. `track_title` varchar(100) DEFAULT '',
  373. `track_short_title` varchar(50) DEFAULT '',
  374. `track_description` longtext DEFAULT NULL,
  375. `school_id` int(11) NOT NULL DEFAULT 0,
  376. PRIMARY KEY (`track_id`) ,
  377. KEY `school_id` (`school_id`)
  378. ); ";
  379. db_query($q);
  380. $q = "
  381. CREATE TABLE `degrees` (
  382. `id` int(11) NOT NULL AUTO_INCREMENT,
  383. `degree_id` int(11) DEFAULT 0,
  384. `major_code` varchar(100) DEFAULT '',
  385. `degree_type` varchar(20) DEFAULT '',
  386. `degree_level` varchar(5) DEFAULT '',
  387. `degree_class` varchar(40) DEFAULT 'MAJOR',
  388. `title` varchar(200) DEFAULT '',
  389. `public_note` longtext DEFAULT NULL,
  390. `semester_titles_csv` longtext DEFAULT NULL,
  391. `catalog_year` int(11) DEFAULT 2006,
  392. `exclude` int(11) DEFAULT 0,
  393. `allow_dynamic` int(11) DEFAULT 0,
  394. `advising_weight` int(11) DEFAULT 0,
  395. `override_degree_hours` varchar(20) DEFAULT '',
  396. `min_tracks` int(11) DEFAULT 0,
  397. `max_tracks` int(11) DEFAULT 0,
  398. `default_tracks` varchar(255) DEFAULT '',
  399. `track_selection_config` longtext DEFAULT NULL,
  400. `school_id` int(11) NOT NULL DEFAULT 0,
  401. PRIMARY KEY (`id`) ,
  402. KEY `degree_id` (`degree_id`) ,
  403. KEY `major_code` (`major_code`) ,
  404. KEY `degree_level` (`degree_level`) ,
  405. KEY `degree_class` (`degree_class`) ,
  406. KEY `allow_dynamic` (`allow_dynamic`) ,
  407. KEY `advising_weight` (`advising_weight`) ,
  408. KEY `catalog_year` (`catalog_year`) ,
  409. KEY `school_id` (`school_id`)
  410. ); ";
  411. db_query($q);
  412. $q = "
  413. CREATE TABLE `draft_courses` (
  414. `id` int(11) NOT NULL AUTO_INCREMENT,
  415. `course_id` int(11) DEFAULT 0,
  416. `subject_id` varchar(10) DEFAULT '',
  417. `course_num` varchar(10) DEFAULT '',
  418. `catalog_year` int(11) DEFAULT 2006,
  419. `title` longtext DEFAULT NULL,
  420. `description` longtext DEFAULT NULL,
  421. `min_hours` decimal(8,4) DEFAULT 0.0000,
  422. `max_hours` decimal(8,4) DEFAULT 0.0000,
  423. `repeat_hours` decimal(8,4) DEFAULT 0.0000,
  424. `exclude` tinyint(4) DEFAULT 0,
  425. `data_entry_comment` longtext DEFAULT NULL,
  426. `delete_flag` tinyint(4) DEFAULT 0,
  427. `school_id` int(11) NOT NULL DEFAULT 0,
  428. PRIMARY KEY (`id`) ,
  429. KEY `course_id` (`course_id`) ,
  430. KEY `subject_id` (`subject_id`) ,
  431. KEY `course_num` (`course_num`) ,
  432. KEY `delete_flag` (`delete_flag`) ,
  433. KEY `exclude` (`exclude`) ,
  434. KEY `catalog_year` (`catalog_year`) ,
  435. KEY `school_id` (`school_id`),
  436. KEY `catalog_year_2` (`catalog_year`,`exclude`,`school_id`,`delete_flag`),
  437. KEY `course_num_2` (`course_num`,`catalog_year`,`exclude`,`delete_flag`,`school_id`),
  438. KEY `catalog_year_3` (`catalog_year`,`exclude`,`delete_flag`)
  439. ); ";
  440. db_query($q);
  441. $q = "
  442. CREATE TABLE `draft_degree_requirements` (
  443. `id` int(11) AUTO_INCREMENT,
  444. `degree_id` int(11) DEFAULT '0',
  445. `semester_num` int(11) DEFAULT '0',
  446. `group_id` int(11) DEFAULT '0',
  447. `group_requirement_type` varchar(10) DEFAULT '',
  448. `group_min_hours_allowed` decimal(8,4) DEFAULT '0.0000',
  449. `group_hours_required` decimal(8,4) DEFAULT '0.0000',
  450. `group_min_grade` varchar(10) DEFAULT '',
  451. `course_id` int(11) DEFAULT '0',
  452. `course_min_grade` varchar(10) DEFAULT '',
  453. `course_requirement_type` varchar(10) DEFAULT '',
  454. `data_entry_value` varchar(50) DEFAULT '',
  455. PRIMARY KEY (`id`),
  456. KEY `degree_id` (`degree_id`),
  457. KEY `group_id` (`group_id`),
  458. KEY `dev` (`data_entry_value`)
  459. );";
  460. db_query($q);
  461. $q = "
  462. CREATE TABLE `draft_degree_tracks` (
  463. `track_id` int(11) NOT NULL AUTO_INCREMENT,
  464. `catalog_year` int(11) DEFAULT 2006,
  465. `major_code` varchar(100) DEFAULT '',
  466. `track_code` varchar(20) DEFAULT '',
  467. `track_title` varchar(100) DEFAULT '',
  468. `track_short_title` varchar(50) DEFAULT '',
  469. `track_description` longtext DEFAULT NULL,
  470. `school_id` int(11) NOT NULL DEFAULT 0,
  471. PRIMARY KEY (`track_id`) ,
  472. KEY `school_id` (`school_id`)
  473. ); ";
  474. db_query($q);
  475. $q = "
  476. CREATE TABLE `draft_degrees` (
  477. `id` int(11) NOT NULL AUTO_INCREMENT,
  478. `degree_id` int(11) DEFAULT 0,
  479. `major_code` varchar(100) DEFAULT '',
  480. `degree_type` varchar(20) DEFAULT '',
  481. `degree_level` varchar(5) DEFAULT '',
  482. `degree_class` varchar(40) DEFAULT 'MAJOR',
  483. `title` varchar(200) DEFAULT '',
  484. `public_note` longtext DEFAULT NULL,
  485. `semester_titles_csv` longtext DEFAULT NULL,
  486. `catalog_year` int(11) DEFAULT 2006,
  487. `exclude` int(11) DEFAULT 0,
  488. `allow_dynamic` int(11) DEFAULT 0,
  489. `advising_weight` int(11) DEFAULT 0,
  490. `override_degree_hours` varchar(20) DEFAULT '',
  491. `min_tracks` int(11) DEFAULT 0,
  492. `max_tracks` int(11) DEFAULT 0,
  493. `default_tracks` varchar(255) DEFAULT '',
  494. `track_selection_config` longtext DEFAULT NULL,
  495. `school_id` int(11) NOT NULL DEFAULT 0,
  496. PRIMARY KEY (`id`) ,
  497. KEY `degree_id` (`degree_id`) ,
  498. KEY `major_code` (`major_code`) ,
  499. KEY `exclude` (`exclude`) ,
  500. KEY `allow_dynamic` (`allow_dynamic`) ,
  501. KEY `advising_weight` (`advising_weight`) ,
  502. KEY `degree_level` (`degree_level`) ,
  503. KEY `degree_class` (`degree_class`) ,
  504. KEY `catalog_year` (`catalog_year`) ,
  505. KEY `school_id` (`school_id`)
  506. ); ";
  507. db_query($q);
  508. $q = "
  509. CREATE TABLE `draft_group_requirements` (
  510. `id` int(11) AUTO_INCREMENT,
  511. `group_id` int(11) DEFAULT '0',
  512. `course_id` int(11) DEFAULT '0',
  513. `course_min_grade` varchar(10) DEFAULT '',
  514. `course_repeats` int(11) DEFAULT '0',
  515. `attributes` varchar(255) DEFAULT '',
  516. `child_group_id` int(11) DEFAULT '0',
  517. `data_entry_value` varchar(50) DEFAULT '',
  518. PRIMARY KEY (`id`),
  519. KEY `group_id` (`group_id`),
  520. KEY `dev` (`data_entry_value`)
  521. ); ";
  522. db_query($q);
  523. $q = "
  524. CREATE TABLE `draft_groups` (
  525. `id` int(11) NOT NULL AUTO_INCREMENT,
  526. `group_id` int(11) DEFAULT 0,
  527. `group_name` varchar(200) DEFAULT '',
  528. `title` varchar(255) DEFAULT '',
  529. `public_note` longtext DEFAULT NULL,
  530. `definition` longtext DEFAULT NULL,
  531. `icon_filename` longtext DEFAULT NULL,
  532. `catalog_year` int(11) DEFAULT 2006,
  533. `priority` int(11) DEFAULT 50,
  534. `delete_flag` tinyint(4) DEFAULT 0,
  535. `data_entry_comment` longtext DEFAULT NULL,
  536. `catalog_repeat` tinyint(4) DEFAULT 0,
  537. `school_id` int(11) NOT NULL DEFAULT 0,
  538. PRIMARY KEY (`id`) ,
  539. KEY `group_id` (`group_id`) ,
  540. KEY `group_name` (`group_name`) ,
  541. KEY `catalog_year` (`catalog_year`) ,
  542. KEY `title` (`title`) ,
  543. KEY `delete_flag` (`delete_flag`) ,
  544. KEY `catalog_repeat` (`catalog_repeat`) ,
  545. KEY `priority` (`priority`) ,
  546. KEY `school_id` (`school_id`)
  547. ); ";
  548. db_query($q);
  549. $q = "
  550. CREATE TABLE `draft_instructions` (
  551. `id` int(11) NOT NULL AUTO_INCREMENT,
  552. `instruction` longtext DEFAULT NULL,
  553. `school_id` int(11) NOT NULL DEFAULT 0,
  554. PRIMARY KEY (`id`) ,
  555. KEY `school_id` (`school_id`)
  556. ); ";
  557. db_query($q);
  558. $q = "
  559. CREATE TABLE `faculty` (
  560. `cwid` varchar(30) NOT NULL,
  561. `college` varchar(255) DEFAULT '',
  562. `department_code` varchar(255) DEFAULT '',
  563. `major_code_csv` varchar(255) DEFAULT '',
  564. PRIMARY KEY (`cwid`),
  565. KEY `major_code_csv` (`major_code_csv`),
  566. KEY `department_code` (`department_code`),
  567. KEY `college` (`college`)
  568. ); ";
  569. db_query($q);
  570. $q = "
  571. CREATE TABLE `group_requirements` (
  572. `id` int(11) AUTO_INCREMENT,
  573. `group_id` int(11) DEFAULT '0',
  574. `course_id` int(11) DEFAULT '0',
  575. `course_min_grade` varchar(10) DEFAULT '',
  576. `course_repeats` int(11) DEFAULT '0',
  577. `attributes` varchar(255) DEFAULT '',
  578. `child_group_id` int(11) DEFAULT '0',
  579. `data_entry_value` varchar(50) DEFAULT '',
  580. PRIMARY KEY (`id`),
  581. KEY `group_id` (`group_id`),
  582. KEY `dev` (`data_entry_value`)
  583. ); ";
  584. db_query($q);
  585. $q = "
  586. CREATE TABLE `groups` (
  587. `id` int(11) NOT NULL AUTO_INCREMENT,
  588. `group_id` int(11) DEFAULT 0,
  589. `group_name` varchar(200) DEFAULT '',
  590. `title` varchar(255) DEFAULT '',
  591. `public_note` longtext DEFAULT NULL,
  592. `definition` longtext DEFAULT NULL,
  593. `icon_filename` longtext DEFAULT NULL,
  594. `catalog_year` int(11) DEFAULT 2006,
  595. `priority` int(11) DEFAULT 50,
  596. `delete_flag` tinyint(4) DEFAULT 0,
  597. `data_entry_comment` longtext DEFAULT NULL,
  598. `catalog_repeat` tinyint(4) DEFAULT 0,
  599. `school_id` int(11) NOT NULL DEFAULT 0,
  600. PRIMARY KEY (`id`) ,
  601. KEY `group_id` (`group_id`) ,
  602. KEY `group_name` (`group_name`) ,
  603. KEY `catalog_year` (`catalog_year`) ,
  604. KEY `title` (`title`) ,
  605. KEY `delete_flag` (`delete_flag`) ,
  606. KEY `catalog_repeat` (`catalog_repeat`) ,
  607. KEY `priority` (`priority`) ,
  608. KEY `school_id` (`school_id`)
  609. ); ";
  610. db_query($q);
  611. $q = "
  612. CREATE TABLE `menu_router` (
  613. `path` varchar(255) ,
  614. `access_callback` varchar(255) DEFAULT '',
  615. `access_arguments` longtext,
  616. `page_callback` varchar(255) DEFAULT '',
  617. `page_arguments` longtext,
  618. `title` varchar(255) DEFAULT '',
  619. `description` longtext,
  620. `type` tinyint(3) unsigned DEFAULT '0',
  621. `tab_family` varchar(255) DEFAULT '',
  622. `tab_parent` varchar(255) DEFAULT '',
  623. `weight` int(11) DEFAULT '0',
  624. `icon` varchar(255) DEFAULT '',
  625. `page_settings` longtext,
  626. `file` varchar(255) DEFAULT '',
  627. PRIMARY KEY (`path`),
  628. KEY `type` (`type`),
  629. KEY `tab_family` (`tab_family`)
  630. ); ";
  631. db_query($q);
  632. $q = "
  633. CREATE TABLE `modules` (
  634. `path` varchar(255) ,
  635. `name` varchar(100) DEFAULT '',
  636. `version` varchar(20) DEFAULT '',
  637. `requires` longtext,
  638. `enabled` int(11) DEFAULT '0',
  639. `weight` int(11) DEFAULT '0',
  640. `type` varchar(20) DEFAULT '',
  641. `schema` int(11) DEFAULT '0',
  642. `info` longtext,
  643. PRIMARY KEY (`path`)
  644. ); ";
  645. db_query($q);
  646. $q = "
  647. CREATE TABLE `role_permissions` (
  648. `pid` int(10) unsigned AUTO_INCREMENT,
  649. `rid` int(10) unsigned DEFAULT '0',
  650. `perm` varchar(255) DEFAULT '',
  651. PRIMARY KEY (`pid`),
  652. KEY `perm` (`perm`),
  653. KEY `rid` (`rid`)
  654. ); ";
  655. db_query($q);
  656. $q = "
  657. CREATE TABLE `roles` (
  658. `rid` int(11) AUTO_INCREMENT,
  659. `name` varchar(255) DEFAULT '',
  660. PRIMARY KEY (`rid`)
  661. ); ";
  662. db_query($q);
  663. $q = "
  664. CREATE TABLE `standardized_tests` (
  665. `id` int(11) NOT NULL AUTO_INCREMENT,
  666. `test_id` varchar(20) DEFAULT '',
  667. `category_id` varchar(20) DEFAULT '',
  668. `position` int(11) DEFAULT 0,
  669. `test_description` varchar(200) DEFAULT '',
  670. `category_description` varchar(200) DEFAULT '',
  671. `school_id` int(11) NOT NULL DEFAULT 0,
  672. PRIMARY KEY (`id`) ,
  673. KEY `school_id` (`school_id`)
  674. ); ";
  675. db_query($q);
  676. $q = "
  677. CREATE TABLE `student_courses` (
  678. `id` int(11) NOT NULL AUTO_INCREMENT,
  679. `student_id` varchar(30) DEFAULT '',
  680. `subject_id` varchar(10) DEFAULT '',
  681. `course_num` varchar(10) DEFAULT '',
  682. `hours_awarded` decimal(8,4) DEFAULT 0.0000,
  683. `grade` varchar(5) DEFAULT '',
  684. `term_id` varchar(20) DEFAULT '',
  685. `level_code` varchar(10) DEFAULT '',
  686. `course_id` int(11) DEFAULT 0,
  687. PRIMARY KEY (`id`) ,
  688. KEY `student_id` (`student_id`) ,
  689. KEY `course_id` (`course_id`) ,
  690. KEY `level_code` (`level_code`)
  691. ); ";
  692. db_query($q);
  693. $q = "
  694. CREATE TABLE `student_degrees` (
  695. `student_id` varchar(30) NOT NULL DEFAULT '',
  696. `major_code` varchar(100) NOT NULL DEFAULT '',
  697. `is_editable` tinyint DEFAULT '0',
  698. `delete_flag` tinyint DEFAULT '0',
  699. `extra_data` varchar(255) DEFAULT NULL,
  700. PRIMARY KEY (`student_id`,`major_code`),
  701. KEY `extra_data` (`extra_data`(250)),
  702. KEY `major_code` (`major_code`),
  703. KEY `delete_flag` (`delete_flag`)
  704. ); ";
  705. db_query($q);
  706. $q = "
  707. CREATE TABLE `student_developmentals` (
  708. `student_id` varchar(30) NOT NULL,
  709. `requirement` varchar(15) NOT NULL DEFAULT '',
  710. PRIMARY KEY (`student_id`,`requirement`),
  711. KEY `requirement` (`requirement`)
  712. ); ";
  713. db_query($q);
  714. $q = "
  715. CREATE TABLE `student_settings` (
  716. `student_id` varchar(30) NOT NULL,
  717. `settings` longtext DEFAULT NULL,
  718. `posted` int(10) unsigned DEFAULT 0,
  719. PRIMARY KEY (`student_id`)
  720. ) ; ";
  721. db_query($q);
  722. $q = "
  723. CREATE TABLE `student_substitutions` (
  724. `id` int(11) NOT NULL AUTO_INCREMENT,
  725. `student_id` varchar(30) DEFAULT '',
  726. `faculty_id` varchar(30) DEFAULT '',
  727. `required_course_id` int(11) DEFAULT 0,
  728. `required_entry_value` varchar(20) DEFAULT '',
  729. `required_group_id` varchar(50) DEFAULT '',
  730. `required_degree_id` int(11) unsigned DEFAULT 0,
  731. `required_semester_num` int(11) DEFAULT 0,
  732. `sub_course_id` int(11) DEFAULT 0,
  733. `sub_entry_value` varchar(20) DEFAULT '',
  734. `sub_term_id` varchar(20) DEFAULT '',
  735. `sub_transfer_flag` tinyint(4) DEFAULT 0,
  736. `sub_hours` decimal(8,4) DEFAULT 0.0000,
  737. `sub_remarks` longtext DEFAULT NULL,
  738. `posted` int(10) unsigned DEFAULT 0,
  739. `delete_flag` tinyint(4) DEFAULT 0,
  740. PRIMARY KEY (`id`),
  741. KEY `student_id` (`student_id`),
  742. KEY `rev` (`required_entry_value`),
  743. KEY `sev` (`sub_entry_value`)
  744. ); ";
  745. db_query($q);
  746. $q = "
  747. CREATE TABLE `student_tests` (
  748. `id` int(11) NOT NULL AUTO_INCREMENT,
  749. `student_id` varchar(30) DEFAULT '',
  750. `test_id` varchar(20) DEFAULT '',
  751. `category_id` varchar(20) DEFAULT '',
  752. `score` varchar(10) DEFAULT '',
  753. `date_taken` datetime DEFAULT '1970-01-01 00:00:01',
  754. `school_id` int(11) NOT NULL DEFAULT 0,
  755. PRIMARY KEY (`id`),
  756. KEY `student_id` (`student_id`),
  757. KEY `school_id` (`school_id`)
  758. ); ";
  759. db_query($q);
  760. $q = "
  761. CREATE TABLE `student_transfer_courses` (
  762. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  763. `student_id` varchar(30) DEFAULT '',
  764. `transfer_course_id` int(11) DEFAULT 0,
  765. `student_specific_course_title` varchar(255) DEFAULT '',
  766. `term_id` varchar(20) DEFAULT '',
  767. `grade` varchar(5) DEFAULT '',
  768. `hours_awarded` decimal(8,4) DEFAULT 0.0000,
  769. `level_code` varchar(10) DEFAULT '',
  770. PRIMARY KEY (`id`) ,
  771. KEY `student_id` (`student_id`) ,
  772. KEY `transfer_id` (`transfer_course_id`) ,
  773. KEY `term_id` (`term_id`) ,
  774. KEY `grade` (`grade`) ,
  775. KEY `level_code` (`level_code`) ,
  776. KEY `hrs` (`hours_awarded`)
  777. ); ";
  778. db_query($q);
  779. $q = "
  780. CREATE TABLE `student_unassign_group` (
  781. `id` int(11) NOT NULL AUTO_INCREMENT,
  782. `student_id` varchar(30) DEFAULT '',
  783. `faculty_id` varchar(30) DEFAULT '',
  784. `course_id` int(11) DEFAULT 0,
  785. `term_id` varchar(20) DEFAULT '',
  786. `transfer_flag` tinyint(4) DEFAULT 0,
  787. `group_id` varchar(50) DEFAULT '',
  788. `degree_id` int(11) DEFAULT 0,
  789. `delete_flag` tinyint(4) DEFAULT 0,
  790. `posted` int(10) unsigned DEFAULT 0,
  791. PRIMARY KEY (`id`),
  792. KEY `student_id` (`student_id`),
  793. KEY `faculty_id` (`faculty_id`),
  794. KEY `delete_flag` (`delete_flag`)
  795. ); ";
  796. db_query($q);
  797. $q = "
  798. CREATE TABLE `student_unassign_transfer_eqv` (
  799. `id` int(11) NOT NULL AUTO_INCREMENT,
  800. `student_id` varchar(30) DEFAULT '',
  801. `faculty_id` varchar(30) DEFAULT '',
  802. `transfer_course_id` int(11) DEFAULT 0,
  803. `delete_flag` tinyint(4) DEFAULT 0,
  804. `posted` int(10) unsigned DEFAULT 0,
  805. `school_id` int(11) NOT NULL DEFAULT 0,
  806. PRIMARY KEY (`id`),
  807. KEY `student_id` (`student_id`),
  808. KEY `faculty_id` (`faculty_id`),
  809. KEY `transfer_course_id` (`transfer_course_id`),
  810. KEY `delete_flag` (`delete_flag`),
  811. KEY `school_id` (`school_id`)
  812. ); ";
  813. db_query($q);
  814. $q = "
  815. CREATE TABLE `students` (
  816. `cwid` varchar(30) NOT NULL DEFAULT '',
  817. `cumulative_hours` varchar(5) DEFAULT '',
  818. `gpa` varchar(5) DEFAULT '',
  819. `rank_code` varchar(5) DEFAULT '',
  820. `catalog_year` int(11) DEFAULT 2006,
  821. `is_active` tinyint(11) DEFAULT 0,
  822. PRIMARY KEY (`cwid`),
  823. KEY `rank_code` (`rank_code`),
  824. KEY `is_active` (`is_active`)
  825. ); ";
  826. db_query($q);
  827. $q = "
  828. CREATE TABLE `subjects` (
  829. `subject_id` varchar(10) NOT NULL,
  830. `college` varchar(10) DEFAULT NULL,
  831. `title` varchar(255) DEFAULT NULL,
  832. `school_id` int(11) NOT NULL DEFAULT 0,
  833. PRIMARY KEY (`subject_id`,`school_id`),
  834. KEY `school_id` (`school_id`)
  835. ); ";
  836. db_query($q);
  837. $q = "
  838. CREATE TABLE `transfer_courses` (
  839. `transfer_course_id` int(11) NOT NULL AUTO_INCREMENT,
  840. `institution_id` varchar(100) DEFAULT '',
  841. `subject_id` varchar(10) DEFAULT '',
  842. `course_num` varchar(10) DEFAULT '',
  843. `title` varchar(100) DEFAULT '',
  844. `description` longtext DEFAULT NULL,
  845. `min_hours` decimal(8,4) DEFAULT 0.0000,
  846. `max_hours` decimal(8,4) DEFAULT 0.0000,
  847. `school_id` int(11) NOT NULL DEFAULT 0,
  848. PRIMARY KEY (`transfer_course_id`) ,
  849. KEY `ic` (`institution_id`) ,
  850. KEY `si` (`subject_id`) ,
  851. KEY `cn` (`course_num`) ,
  852. KEY `school_id` (`school_id`)
  853. ); ";
  854. db_query($q);
  855. $q = "
  856. CREATE TABLE `transfer_eqv_per_student` (
  857. `id` int(11) NOT NULL AUTO_INCREMENT,
  858. `student_id` varchar(30) DEFAULT '',
  859. `transfer_course_id` int(11) DEFAULT 0,
  860. `local_course_id` int(11) DEFAULT 0,
  861. `valid_term_id` varchar(20) DEFAULT '',
  862. `broken_id` int(11) DEFAULT 0,
  863. PRIMARY KEY (`id`) ,
  864. KEY `student_id` (`student_id`) ,
  865. KEY `transfer_course_id` (`transfer_course_id`) ,
  866. KEY `local_course_id` (`local_course_id`) ,
  867. KEY `broken_id` (`broken_id`)
  868. ); ";
  869. db_query($q);
  870. $q = "
  871. CREATE TABLE `transfer_institutions` (
  872. `institution_id` varchar(100) NOT NULL DEFAULT '',
  873. `name` varchar(200) DEFAULT '',
  874. `state` varchar(10) DEFAULT '',
  875. `school_id` int(11) NOT NULL DEFAULT 0,
  876. PRIMARY KEY (`institution_id`) ,
  877. KEY `state` (`state`) ,
  878. KEY `name` (`name`) ,
  879. KEY `school_id` (`school_id`)
  880. ); ";
  881. db_query($q);
  882. $q = "
  883. CREATE TABLE `user_roles` (
  884. `user_id` int(11) ,
  885. `rid` int(11) DEFAULT '0',
  886. PRIMARY KEY (`user_id`,`rid`),
  887. KEY (`rid`)
  888. ); ";
  889. db_query($q);
  890. $q = "
  891. CREATE TABLE `user_settings` (
  892. `user_id` int(11) NOT NULL,
  893. `name` varchar(255) NOT NULL,
  894. `value` longtext DEFAULT NULL,
  895. `updated` int(10) unsigned DEFAULT NULL,
  896. PRIMARY KEY (`user_id`,`name`),
  897. KEY `value` (`value`(768)),
  898. KEY `user_id` (`user_id`),
  899. KEY `name` (`name`),
  900. KEY `updated` (`updated`)
  901. );";
  902. db_query($q);
  903. $q = "
  904. CREATE TABLE `users` (
  905. `user_id` int(11) NOT NULL AUTO_INCREMENT,
  906. `user_name` varchar(50) DEFAULT '',
  907. `password` varchar(255) DEFAULT '',
  908. `is_student` tinyint(4) DEFAULT 0,
  909. `is_faculty` tinyint(4) DEFAULT 0,
  910. `email` varchar(255) DEFAULT '',
  911. `cwid` varchar(30) DEFAULT '',
  912. `f_name` varchar(100) DEFAULT '',
  913. `l_name` varchar(100) DEFAULT '',
  914. `is_disabled` tinyint(4) DEFAULT 0,
  915. `last_login` int(10) unsigned DEFAULT 0,
  916. `school_id` int(11) NOT NULL DEFAULT 0,
  917. PRIMARY KEY (`user_id`) ,
  918. KEY `cwid` (`cwid`) ,
  919. KEY `user_name` (`user_name`) ,
  920. KEY `is_disabled` (`is_disabled`) ,
  921. KEY `is_faculty` (`is_faculty`) ,
  922. KEY `is_student` (`is_student`) ,
  923. KEY `school_id` (`school_id`)
  924. ); ";
  925. db_query($q);
  926. $q = "
  927. CREATE TABLE `variables` (
  928. `name` varchar(255) ,
  929. `value` longtext,
  930. PRIMARY KEY (`name`)
  931. ); ";
  932. db_query($q);
  933. $q = "
  934. CREATE TABLE `student_priority` (
  935. `student_id` varchar(30) NOT NULL,
  936. `priority_value` decimal(8,4) DEFAULT NULL,
  937. `results` longtext DEFAULT NULL,
  938. `updated` int(10) unsigned DEFAULT NULL,
  939. PRIMARY KEY (`student_id`) ,
  940. KEY `priority_value` (`priority_value`),
  941. KEY `updated` (`updated`)
  942. ); ";
  943. db_query($q);
  944. $q = "
  945. CREATE TABLE `user_attributes` (
  946. `user_id` int(11) NOT NULL,
  947. `name` varchar(255) NOT NULL,
  948. `value` longtext DEFAULT NULL,
  949. `updated` int(10) unsigned DEFAULT NULL,
  950. PRIMARY KEY (`user_id`,`name`),
  951. KEY `value` (`value`(768)),
  952. KEY `user_id` (`user_id`),
  953. KEY `name` (`name`),
  954. KEY `updated` (`updated`)
  955. ); ";
  956. db_query($q);
  957. $q = "
  958. CREATE TABLE `watchdog` (
  959. `wid` int(11) unsigned NOT NULL AUTO_INCREMENT,
  960. `user_id` int(11) unsigned DEFAULT 0,
  961. `user_name` varchar(50) DEFAULT '',
  962. `cwid` varchar(30) DEFAULT '',
  963. `type` varchar(100) DEFAULT '',
  964. `message` longtext DEFAULT NULL,
  965. `variables` longtext DEFAULT NULL,
  966. `severity` tinyint(3) unsigned DEFAULT 0,
  967. `extra_data` varchar(255) DEFAULT '',
  968. `location` longtext DEFAULT NULL,
  969. `referer` longtext DEFAULT NULL,
  970. `ip` varchar(64) DEFAULT '',
  971. `is_mobile` tinyint(4) DEFAULT 0,
  972. `is_student` tinyint(4) DEFAULT 0,
  973. `is_faculty` tinyint(4) DEFAULT 0,
  974. `timestamp` int(11) unsigned DEFAULT 0,
  975. `school_id` int(11) NOT NULL DEFAULT 0,
  976. PRIMARY KEY (`wid`),
  977. KEY `type` (`type`),
  978. KEY `uid` (`user_id`),
  979. KEY `uname` (`user_name`),
  980. KEY `severity` (`severity`),
  981. KEY `cwid` (`cwid`),
  982. KEY `timestamp` (`timestamp`),
  983. KEY `is_student` (`is_student`),
  984. KEY `is_faculty` (`is_faculty`),
  985. KEY `school_id` (`school_id`)
  986. ); ";
  987. db_query($q);
  988. }

Functions

Namesort descending Description
system_enable Implementation of hook_enable.
system_install Implementation of hook_install.
system_update