system.install

  1. 6.x modules/system/system.install
  2. 4.x modules/system/system.install
  3. 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. ); ";
  327. db_query($q);
  328. db_query("CREATE TABLE `colleges` (
  329. `college_code` varchar(10) NOT NULL,
  330. `title` varchar(255) DEFAULT '',
  331. `school_id` int(11) NOT NULL DEFAULT 0,
  332. PRIMARY KEY (`college_code`,`school_id`),
  333. KEY `school_id` (`school_id`)
  334. ); ");
  335. db_query("CREATE TABLE `degree_college` (
  336. `major_code` varchar(100) NOT NULL DEFAULT '',
  337. `college_code` varchar(10) DEFAULT '',
  338. `school_id` int(11) NOT NULL DEFAULT 0,
  339. PRIMARY KEY (`major_code`,`school_id`),
  340. KEY `college_code` (`college_code`),
  341. KEY `school_id` (`school_id`)
  342. ); ");
  343. $q = "
  344. CREATE TABLE `degree_requirements` (
  345. `id` int(11) AUTO_INCREMENT,
  346. `degree_id` int(11) DEFAULT '0',
  347. `semester_num` int(11) DEFAULT '0',
  348. `group_id` int(11) DEFAULT '0',
  349. `group_requirement_type` varchar(10) DEFAULT '',
  350. `group_min_hours_allowed` decimal(8,4) DEFAULT '0.0000',
  351. `group_hours_required` decimal(8,4) DEFAULT '0.0000',
  352. `group_min_grade` varchar(10) DEFAULT '',
  353. `course_id` int(11) DEFAULT '0',
  354. `course_min_grade` varchar(10) DEFAULT '',
  355. `course_requirement_type` varchar(10) DEFAULT '',
  356. `data_entry_value` varchar(50) DEFAULT '',
  357. PRIMARY KEY (`id`),
  358. KEY `degree_id` (`degree_id`),
  359. KEY `group_id` (`group_id`),
  360. KEY `dev` (`data_entry_value`)
  361. ); ";
  362. db_query($q);
  363. $q = "
  364. CREATE TABLE `degree_tracks` (
  365. `track_id` int(11) NOT NULL AUTO_INCREMENT,
  366. `catalog_year` int(11) DEFAULT 2006,
  367. `major_code` varchar(100) DEFAULT '',
  368. `track_code` varchar(20) DEFAULT '',
  369. `track_title` varchar(100) DEFAULT '',
  370. `track_short_title` varchar(50) DEFAULT '',
  371. `track_description` longtext DEFAULT NULL,
  372. `school_id` int(11) NOT NULL DEFAULT 0,
  373. PRIMARY KEY (`track_id`) ,
  374. KEY `school_id` (`school_id`)
  375. ); ";
  376. db_query($q);
  377. $q = "
  378. CREATE TABLE `degrees` (
  379. `id` int(11) NOT NULL AUTO_INCREMENT,
  380. `degree_id` int(11) DEFAULT 0,
  381. `major_code` varchar(100) DEFAULT '',
  382. `degree_type` varchar(20) DEFAULT '',
  383. `degree_level` varchar(5) DEFAULT '',
  384. `degree_class` varchar(40) DEFAULT 'MAJOR',
  385. `title` varchar(200) DEFAULT '',
  386. `public_note` longtext DEFAULT NULL,
  387. `semester_titles_csv` longtext DEFAULT NULL,
  388. `catalog_year` int(11) DEFAULT 2006,
  389. `exclude` int(11) DEFAULT 0,
  390. `allow_dynamic` int(11) DEFAULT 0,
  391. `advising_weight` int(11) DEFAULT 0,
  392. `override_degree_hours` varchar(20) DEFAULT '',
  393. `min_tracks` int(11) DEFAULT 0,
  394. `max_tracks` int(11) DEFAULT 0,
  395. `default_tracks` varchar(255) DEFAULT '',
  396. `track_selection_config` longtext DEFAULT NULL,
  397. `school_id` int(11) NOT NULL DEFAULT 0,
  398. PRIMARY KEY (`id`) ,
  399. KEY `degree_id` (`degree_id`) ,
  400. KEY `major_code` (`major_code`) ,
  401. KEY `degree_level` (`degree_level`) ,
  402. KEY `degree_class` (`degree_class`) ,
  403. KEY `allow_dynamic` (`allow_dynamic`) ,
  404. KEY `advising_weight` (`advising_weight`) ,
  405. KEY `catalog_year` (`catalog_year`) ,
  406. KEY `school_id` (`school_id`)
  407. ); ";
  408. db_query($q);
  409. $q = "
  410. CREATE TABLE `draft_courses` (
  411. `id` int(11) NOT NULL AUTO_INCREMENT,
  412. `course_id` int(11) DEFAULT 0,
  413. `subject_id` varchar(10) DEFAULT '',
  414. `course_num` varchar(10) DEFAULT '',
  415. `catalog_year` int(11) DEFAULT 2006,
  416. `title` longtext DEFAULT NULL,
  417. `description` longtext DEFAULT NULL,
  418. `min_hours` decimal(8,4) DEFAULT 0.0000,
  419. `max_hours` decimal(8,4) DEFAULT 0.0000,
  420. `repeat_hours` decimal(8,4) DEFAULT 0.0000,
  421. `exclude` tinyint(4) DEFAULT 0,
  422. `data_entry_comment` longtext DEFAULT NULL,
  423. `delete_flag` tinyint(4) DEFAULT 0,
  424. `school_id` int(11) NOT NULL DEFAULT 0,
  425. PRIMARY KEY (`id`) ,
  426. KEY `course_id` (`course_id`) ,
  427. KEY `subject_id` (`subject_id`) ,
  428. KEY `course_num` (`course_num`) ,
  429. KEY `delete_flag` (`delete_flag`) ,
  430. KEY `exclude` (`exclude`) ,
  431. KEY `catalog_year` (`catalog_year`) ,
  432. KEY `school_id` (`school_id`)
  433. ); ";
  434. db_query($q);
  435. $q = "
  436. CREATE TABLE `draft_degree_requirements` (
  437. `id` int(11) AUTO_INCREMENT,
  438. `degree_id` int(11) DEFAULT '0',
  439. `semester_num` int(11) DEFAULT '0',
  440. `group_id` int(11) DEFAULT '0',
  441. `group_requirement_type` varchar(10) DEFAULT '',
  442. `group_min_hours_allowed` decimal(8,4) DEFAULT '0.0000',
  443. `group_hours_required` decimal(8,4) DEFAULT '0.0000',
  444. `group_min_grade` varchar(10) DEFAULT '',
  445. `course_id` int(11) DEFAULT '0',
  446. `course_min_grade` varchar(10) DEFAULT '',
  447. `course_requirement_type` varchar(10) DEFAULT '',
  448. `data_entry_value` varchar(50) DEFAULT '',
  449. PRIMARY KEY (`id`),
  450. KEY `degree_id` (`degree_id`),
  451. KEY `group_id` (`group_id`),
  452. KEY `dev` (`data_entry_value`)
  453. );";
  454. db_query($q);
  455. $q = "
  456. CREATE TABLE `draft_degree_tracks` (
  457. `track_id` int(11) NOT NULL AUTO_INCREMENT,
  458. `catalog_year` int(11) DEFAULT 2006,
  459. `major_code` varchar(100) DEFAULT '',
  460. `track_code` varchar(20) DEFAULT '',
  461. `track_title` varchar(100) DEFAULT '',
  462. `track_short_title` varchar(50) DEFAULT '',
  463. `track_description` longtext DEFAULT NULL,
  464. `school_id` int(11) NOT NULL DEFAULT 0,
  465. PRIMARY KEY (`track_id`) ,
  466. KEY `school_id` (`school_id`)
  467. ); ";
  468. db_query($q);
  469. $q = "
  470. CREATE TABLE `draft_degrees` (
  471. `id` int(11) NOT NULL AUTO_INCREMENT,
  472. `degree_id` int(11) DEFAULT 0,
  473. `major_code` varchar(100) DEFAULT '',
  474. `degree_type` varchar(20) DEFAULT '',
  475. `degree_level` varchar(5) DEFAULT '',
  476. `degree_class` varchar(40) DEFAULT 'MAJOR',
  477. `title` varchar(200) DEFAULT '',
  478. `public_note` longtext DEFAULT NULL,
  479. `semester_titles_csv` longtext DEFAULT NULL,
  480. `catalog_year` int(11) DEFAULT 2006,
  481. `exclude` int(11) DEFAULT 0,
  482. `allow_dynamic` int(11) DEFAULT 0,
  483. `advising_weight` int(11) DEFAULT 0,
  484. `override_degree_hours` varchar(20) DEFAULT '',
  485. `min_tracks` int(11) DEFAULT 0,
  486. `max_tracks` int(11) DEFAULT 0,
  487. `default_tracks` varchar(255) DEFAULT '',
  488. `track_selection_config` longtext DEFAULT NULL,
  489. `school_id` int(11) NOT NULL DEFAULT 0,
  490. PRIMARY KEY (`id`) ,
  491. KEY `degree_id` (`degree_id`) ,
  492. KEY `major_code` (`major_code`) ,
  493. KEY `exclude` (`exclude`) ,
  494. KEY `allow_dynamic` (`allow_dynamic`) ,
  495. KEY `advising_weight` (`advising_weight`) ,
  496. KEY `degree_level` (`degree_level`) ,
  497. KEY `degree_class` (`degree_class`) ,
  498. KEY `catalog_year` (`catalog_year`) ,
  499. KEY `school_id` (`school_id`)
  500. ); ";
  501. db_query($q);
  502. $q = "
  503. CREATE TABLE `draft_group_requirements` (
  504. `id` int(11) AUTO_INCREMENT,
  505. `group_id` int(11) DEFAULT '0',
  506. `course_id` int(11) DEFAULT '0',
  507. `course_min_grade` varchar(10) DEFAULT '',
  508. `course_repeats` int(11) DEFAULT '0',
  509. `attributes` varchar(255) DEFAULT '',
  510. `child_group_id` int(11) DEFAULT '0',
  511. `data_entry_value` varchar(50) DEFAULT '',
  512. PRIMARY KEY (`id`),
  513. KEY `group_id` (`group_id`),
  514. KEY `dev` (`data_entry_value`)
  515. ); ";
  516. db_query($q);
  517. $q = "
  518. CREATE TABLE `draft_groups` (
  519. `id` int(11) NOT NULL AUTO_INCREMENT,
  520. `group_id` int(11) DEFAULT 0,
  521. `group_name` varchar(200) DEFAULT '',
  522. `title` varchar(255) DEFAULT '',
  523. `public_note` longtext DEFAULT NULL,
  524. `definition` longtext DEFAULT NULL,
  525. `icon_filename` longtext DEFAULT NULL,
  526. `catalog_year` int(11) DEFAULT 2006,
  527. `priority` int(11) DEFAULT 50,
  528. `delete_flag` tinyint(4) DEFAULT 0,
  529. `data_entry_comment` longtext DEFAULT NULL,
  530. `catalog_repeat` tinyint(4) DEFAULT 0,
  531. `school_id` int(11) NOT NULL DEFAULT 0,
  532. PRIMARY KEY (`id`) ,
  533. KEY `group_id` (`group_id`) ,
  534. KEY `group_name` (`group_name`) ,
  535. KEY `catalog_year` (`catalog_year`) ,
  536. KEY `title` (`title`) ,
  537. KEY `delete_flag` (`delete_flag`) ,
  538. KEY `catalog_repeat` (`catalog_repeat`) ,
  539. KEY `priority` (`priority`) ,
  540. KEY `school_id` (`school_id`)
  541. ); ";
  542. db_query($q);
  543. $q = "
  544. CREATE TABLE `draft_instructions` (
  545. `id` int(11) NOT NULL AUTO_INCREMENT,
  546. `instruction` longtext DEFAULT NULL,
  547. `school_id` int(11) NOT NULL DEFAULT 0,
  548. PRIMARY KEY (`id`) ,
  549. KEY `school_id` (`school_id`)
  550. ); ";
  551. db_query($q);
  552. $q = "
  553. CREATE TABLE `faculty` (
  554. `cwid` varchar(30) NOT NULL,
  555. `college` varchar(255) DEFAULT '',
  556. `department_code` varchar(255) DEFAULT '',
  557. `major_code_csv` varchar(255) DEFAULT '',
  558. PRIMARY KEY (`cwid`),
  559. KEY `major_code_csv` (`major_code_csv`),
  560. KEY `department_code` (`department_code`),
  561. KEY `college` (`college`)
  562. ); ";
  563. db_query($q);
  564. $q = "
  565. CREATE TABLE `group_requirements` (
  566. `id` int(11) AUTO_INCREMENT,
  567. `group_id` int(11) DEFAULT '0',
  568. `course_id` int(11) DEFAULT '0',
  569. `course_min_grade` varchar(10) DEFAULT '',
  570. `course_repeats` int(11) DEFAULT '0',
  571. `attributes` varchar(255) DEFAULT '',
  572. `child_group_id` int(11) DEFAULT '0',
  573. `data_entry_value` varchar(50) DEFAULT '',
  574. PRIMARY KEY (`id`),
  575. KEY `group_id` (`group_id`),
  576. KEY `dev` (`data_entry_value`)
  577. ); ";
  578. db_query($q);
  579. $q = "
  580. CREATE TABLE `groups` (
  581. `id` int(11) NOT NULL AUTO_INCREMENT,
  582. `group_id` int(11) DEFAULT 0,
  583. `group_name` varchar(200) DEFAULT '',
  584. `title` varchar(255) DEFAULT '',
  585. `public_note` longtext DEFAULT NULL,
  586. `definition` longtext DEFAULT NULL,
  587. `icon_filename` longtext DEFAULT NULL,
  588. `catalog_year` int(11) DEFAULT 2006,
  589. `priority` int(11) DEFAULT 50,
  590. `delete_flag` tinyint(4) DEFAULT 0,
  591. `data_entry_comment` longtext DEFAULT NULL,
  592. `catalog_repeat` tinyint(4) DEFAULT 0,
  593. `school_id` int(11) NOT NULL DEFAULT 0,
  594. PRIMARY KEY (`id`) ,
  595. KEY `group_id` (`group_id`) ,
  596. KEY `group_name` (`group_name`) ,
  597. KEY `catalog_year` (`catalog_year`) ,
  598. KEY `title` (`title`) ,
  599. KEY `delete_flag` (`delete_flag`) ,
  600. KEY `catalog_repeat` (`catalog_repeat`) ,
  601. KEY `priority` (`priority`) ,
  602. KEY `school_id` (`school_id`)
  603. ); ";
  604. db_query($q);
  605. $q = "
  606. CREATE TABLE `menu_router` (
  607. `path` varchar(255) ,
  608. `access_callback` varchar(255) DEFAULT '',
  609. `access_arguments` longtext,
  610. `page_callback` varchar(255) DEFAULT '',
  611. `page_arguments` longtext,
  612. `title` varchar(255) DEFAULT '',
  613. `description` longtext,
  614. `type` tinyint(3) unsigned DEFAULT '0',
  615. `tab_family` varchar(255) DEFAULT '',
  616. `tab_parent` varchar(255) DEFAULT '',
  617. `weight` int(11) DEFAULT '0',
  618. `icon` varchar(255) DEFAULT '',
  619. `page_settings` longtext,
  620. `file` varchar(255) DEFAULT '',
  621. PRIMARY KEY (`path`),
  622. KEY `type` (`type`),
  623. KEY `tab_family` (`tab_family`)
  624. ); ";
  625. db_query($q);
  626. $q = "
  627. CREATE TABLE `modules` (
  628. `path` varchar(255) ,
  629. `name` varchar(100) DEFAULT '',
  630. `version` varchar(20) DEFAULT '',
  631. `requires` longtext,
  632. `enabled` int(11) DEFAULT '0',
  633. `weight` int(11) DEFAULT '0',
  634. `type` varchar(20) DEFAULT '',
  635. `schema` int(11) DEFAULT '0',
  636. `info` longtext,
  637. PRIMARY KEY (`path`)
  638. ); ";
  639. db_query($q);
  640. $q = "
  641. CREATE TABLE `role_permissions` (
  642. `pid` int(10) unsigned AUTO_INCREMENT,
  643. `rid` int(10) unsigned DEFAULT '0',
  644. `perm` varchar(255) DEFAULT '',
  645. PRIMARY KEY (`pid`),
  646. KEY `perm` (`perm`),
  647. KEY `rid` (`rid`)
  648. ); ";
  649. db_query($q);
  650. $q = "
  651. CREATE TABLE `roles` (
  652. `rid` int(11) AUTO_INCREMENT,
  653. `name` varchar(255) DEFAULT '',
  654. PRIMARY KEY (`rid`)
  655. ); ";
  656. db_query($q);
  657. $q = "
  658. CREATE TABLE `standardized_tests` (
  659. `id` int(11) NOT NULL AUTO_INCREMENT,
  660. `test_id` varchar(20) DEFAULT '',
  661. `category_id` varchar(20) DEFAULT '',
  662. `position` int(11) DEFAULT 0,
  663. `test_description` varchar(200) DEFAULT '',
  664. `category_description` varchar(200) DEFAULT '',
  665. `school_id` int(11) NOT NULL DEFAULT 0,
  666. PRIMARY KEY (`id`) ,
  667. KEY `school_id` (`school_id`)
  668. ); ";
  669. db_query($q);
  670. $q = "
  671. CREATE TABLE `student_courses` (
  672. `id` int(11) NOT NULL AUTO_INCREMENT,
  673. `student_id` varchar(30) DEFAULT '',
  674. `subject_id` varchar(10) DEFAULT '',
  675. `course_num` varchar(10) DEFAULT '',
  676. `hours_awarded` decimal(8,4) DEFAULT 0.0000,
  677. `grade` varchar(5) DEFAULT '',
  678. `term_id` varchar(20) DEFAULT '',
  679. `level_code` varchar(10) DEFAULT '',
  680. `course_id` int(11) DEFAULT 0,
  681. PRIMARY KEY (`id`) ,
  682. KEY `student_id` (`student_id`) ,
  683. KEY `course_id` (`course_id`) ,
  684. KEY `level_code` (`level_code`)
  685. ); ";
  686. db_query($q);
  687. $q = "
  688. CREATE TABLE `student_degrees` (
  689. `student_id` varchar(30) NOT NULL DEFAULT '',
  690. `major_code` varchar(100) NOT NULL DEFAULT '',
  691. `is_editable` tinyint DEFAULT '0',
  692. `delete_flag` tinyint DEFAULT '0',
  693. `extra_data` varchar(255) DEFAULT NULL,
  694. PRIMARY KEY (`student_id`,`major_code`),
  695. KEY `extra_data` (`extra_data`(250)),
  696. KEY `major_code` (`major_code`),
  697. KEY `delete_flag` (`delete_flag`)
  698. ); ";
  699. db_query($q);
  700. $q = "
  701. CREATE TABLE `student_developmentals` (
  702. `student_id` varchar(30) NOT NULL,
  703. `requirement` varchar(15) NOT NULL DEFAULT '',
  704. PRIMARY KEY (`student_id`,`requirement`),
  705. KEY `requirement` (`requirement`)
  706. ); ";
  707. db_query($q);
  708. $q = "
  709. CREATE TABLE `student_settings` (
  710. `student_id` varchar(30) NOT NULL,
  711. `settings` longtext DEFAULT NULL,
  712. `posted` int(10) unsigned DEFAULT 0,
  713. PRIMARY KEY (`student_id`)
  714. ) ; ";
  715. db_query($q);
  716. $q = "
  717. CREATE TABLE `student_substitutions` (
  718. `id` int(11) NOT NULL AUTO_INCREMENT,
  719. `student_id` varchar(30) DEFAULT '',
  720. `faculty_id` varchar(30) DEFAULT '',
  721. `required_course_id` int(11) DEFAULT 0,
  722. `required_entry_value` varchar(20) DEFAULT '',
  723. `required_group_id` varchar(50) DEFAULT '',
  724. `required_degree_id` int(11) unsigned DEFAULT 0,
  725. `required_semester_num` int(11) DEFAULT 0,
  726. `sub_course_id` int(11) DEFAULT 0,
  727. `sub_entry_value` varchar(20) DEFAULT '',
  728. `sub_term_id` varchar(20) DEFAULT '',
  729. `sub_transfer_flag` tinyint(4) DEFAULT 0,
  730. `sub_hours` decimal(8,4) DEFAULT 0.0000,
  731. `sub_remarks` longtext DEFAULT NULL,
  732. `posted` int(10) unsigned DEFAULT 0,
  733. `delete_flag` tinyint(4) DEFAULT 0,
  734. PRIMARY KEY (`id`),
  735. KEY `student_id` (`student_id`),
  736. KEY `rev` (`required_entry_value`),
  737. KEY `sev` (`sub_entry_value`)
  738. ); ";
  739. db_query($q);
  740. $q = "
  741. CREATE TABLE `student_tests` (
  742. `id` int(11) NOT NULL AUTO_INCREMENT,
  743. `student_id` varchar(30) DEFAULT '',
  744. `test_id` varchar(20) DEFAULT '',
  745. `category_id` varchar(20) DEFAULT '',
  746. `score` varchar(10) DEFAULT '',
  747. `date_taken` datetime DEFAULT '1970-01-01 00:00:01',
  748. `school_id` int(11) NOT NULL DEFAULT 0,
  749. PRIMARY KEY (`id`),
  750. KEY `student_id` (`student_id`),
  751. KEY `school_id` (`school_id`)
  752. ); ";
  753. db_query($q);
  754. $q = "
  755. CREATE TABLE `student_transfer_courses` (
  756. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  757. `student_id` varchar(30) DEFAULT '',
  758. `transfer_course_id` int(11) DEFAULT 0,
  759. `student_specific_course_title` varchar(255) DEFAULT '',
  760. `term_id` varchar(20) DEFAULT '',
  761. `grade` varchar(5) DEFAULT '',
  762. `hours_awarded` decimal(8,4) DEFAULT 0.0000,
  763. `level_code` varchar(10) DEFAULT '',
  764. PRIMARY KEY (`id`) ,
  765. KEY `student_id` (`student_id`) ,
  766. KEY `transfer_id` (`transfer_course_id`) ,
  767. KEY `term_id` (`term_id`) ,
  768. KEY `grade` (`grade`) ,
  769. KEY `level_code` (`level_code`) ,
  770. KEY `hrs` (`hours_awarded`)
  771. ); ";
  772. db_query($q);
  773. $q = "
  774. CREATE TABLE `student_unassign_group` (
  775. `id` int(11) NOT NULL AUTO_INCREMENT,
  776. `student_id` varchar(30) DEFAULT '',
  777. `faculty_id` varchar(30) DEFAULT '',
  778. `course_id` int(11) DEFAULT 0,
  779. `term_id` varchar(20) DEFAULT '',
  780. `transfer_flag` tinyint(4) DEFAULT 0,
  781. `group_id` varchar(50) DEFAULT '',
  782. `degree_id` int(11) DEFAULT 0,
  783. `delete_flag` tinyint(4) DEFAULT 0,
  784. `posted` int(10) unsigned DEFAULT 0,
  785. PRIMARY KEY (`id`),
  786. KEY `student_id` (`student_id`),
  787. KEY `faculty_id` (`faculty_id`),
  788. KEY `delete_flag` (`delete_flag`)
  789. ); ";
  790. db_query($q);
  791. $q = "
  792. CREATE TABLE `student_unassign_transfer_eqv` (
  793. `id` int(11) NOT NULL AUTO_INCREMENT,
  794. `student_id` varchar(30) DEFAULT '',
  795. `faculty_id` varchar(30) DEFAULT '',
  796. `transfer_course_id` int(11) DEFAULT 0,
  797. `delete_flag` tinyint(4) DEFAULT 0,
  798. `posted` int(10) unsigned DEFAULT 0,
  799. `school_id` int(11) NOT NULL DEFAULT 0,
  800. PRIMARY KEY (`id`),
  801. KEY `student_id` (`student_id`),
  802. KEY `faculty_id` (`faculty_id`),
  803. KEY `transfer_course_id` (`transfer_course_id`),
  804. KEY `delete_flag` (`delete_flag`),
  805. KEY `school_id` (`school_id`)
  806. ); ";
  807. db_query($q);
  808. $q = "
  809. CREATE TABLE `students` (
  810. `cwid` varchar(30) NOT NULL DEFAULT '',
  811. `cumulative_hours` varchar(5) DEFAULT '',
  812. `gpa` varchar(5) DEFAULT '',
  813. `rank_code` varchar(5) DEFAULT '',
  814. `catalog_year` int(11) DEFAULT 2006,
  815. `is_active` tinyint(11) DEFAULT 0,
  816. PRIMARY KEY (`cwid`),
  817. KEY `rank_code` (`rank_code`),
  818. KEY `is_active` (`is_active`)
  819. ); ";
  820. db_query($q);
  821. $q = "
  822. CREATE TABLE `subjects` (
  823. `subject_id` varchar(10) NOT NULL,
  824. `college` varchar(10) DEFAULT NULL,
  825. `title` varchar(255) DEFAULT NULL,
  826. `school_id` int(11) NOT NULL DEFAULT 0,
  827. PRIMARY KEY (`subject_id`,`school_id`),
  828. KEY `school_id` (`school_id`)
  829. ); ";
  830. db_query($q);
  831. $q = "
  832. CREATE TABLE `transfer_courses` (
  833. `transfer_course_id` int(11) NOT NULL AUTO_INCREMENT,
  834. `institution_id` varchar(100) DEFAULT '',
  835. `subject_id` varchar(10) DEFAULT '',
  836. `course_num` varchar(10) DEFAULT '',
  837. `title` varchar(100) DEFAULT '',
  838. `description` longtext DEFAULT NULL,
  839. `min_hours` decimal(8,4) DEFAULT 0.0000,
  840. `max_hours` decimal(8,4) DEFAULT 0.0000,
  841. `school_id` int(11) NOT NULL DEFAULT 0,
  842. PRIMARY KEY (`transfer_course_id`) ,
  843. KEY `ic` (`institution_id`) ,
  844. KEY `si` (`subject_id`) ,
  845. KEY `cn` (`course_num`) ,
  846. KEY `school_id` (`school_id`)
  847. ); ";
  848. db_query($q);
  849. $q = "
  850. CREATE TABLE `transfer_eqv_per_student` (
  851. `id` int(11) NOT NULL AUTO_INCREMENT,
  852. `student_id` varchar(30) DEFAULT '',
  853. `transfer_course_id` int(11) DEFAULT 0,
  854. `local_course_id` int(11) DEFAULT 0,
  855. `valid_term_id` varchar(20) DEFAULT '',
  856. `broken_id` int(11) DEFAULT 0,
  857. PRIMARY KEY (`id`) ,
  858. KEY `student_id` (`student_id`) ,
  859. KEY `transfer_course_id` (`transfer_course_id`) ,
  860. KEY `local_course_id` (`local_course_id`) ,
  861. KEY `broken_id` (`broken_id`)
  862. ); ";
  863. db_query($q);
  864. $q = "
  865. CREATE TABLE `transfer_institutions` (
  866. `institution_id` varchar(100) NOT NULL DEFAULT '',
  867. `name` varchar(200) DEFAULT '',
  868. `state` varchar(10) DEFAULT '',
  869. `school_id` int(11) NOT NULL DEFAULT 0,
  870. PRIMARY KEY (`institution_id`) ,
  871. KEY `state` (`state`) ,
  872. KEY `name` (`name`) ,
  873. KEY `school_id` (`school_id`)
  874. ); ";
  875. db_query($q);
  876. $q = "
  877. CREATE TABLE `user_roles` (
  878. `user_id` int(11) ,
  879. `rid` int(11) DEFAULT '0',
  880. PRIMARY KEY (`user_id`,`rid`),
  881. KEY (`rid`)
  882. ); ";
  883. db_query($q);
  884. $q = "
  885. CREATE TABLE `user_settings` (
  886. `user_id` int(11) NOT NULL,
  887. `name` varchar(255) NOT NULL,
  888. `value` longtext DEFAULT NULL,
  889. `updated` int(10) unsigned DEFAULT NULL,
  890. PRIMARY KEY (`user_id`,`name`),
  891. KEY `value` (`value`(768)),
  892. KEY `user_id` (`user_id`),
  893. KEY `name` (`name`),
  894. KEY `updated` (`updated`)
  895. );";
  896. db_query($q);
  897. $q = "
  898. CREATE TABLE `users` (
  899. `user_id` int(11) NOT NULL AUTO_INCREMENT,
  900. `user_name` varchar(50) DEFAULT '',
  901. `password` varchar(255) DEFAULT '',
  902. `is_student` tinyint(4) DEFAULT 0,
  903. `is_faculty` tinyint(4) DEFAULT 0,
  904. `email` varchar(255) DEFAULT '',
  905. `cwid` varchar(30) DEFAULT '',
  906. `f_name` varchar(100) DEFAULT '',
  907. `l_name` varchar(100) DEFAULT '',
  908. `is_disabled` tinyint(4) DEFAULT 0,
  909. `last_login` int(10) unsigned DEFAULT 0,
  910. `school_id` int(11) NOT NULL DEFAULT 0,
  911. PRIMARY KEY (`user_id`) ,
  912. KEY `cwid` (`cwid`) ,
  913. KEY `user_name` (`user_name`) ,
  914. KEY `is_disabled` (`is_disabled`) ,
  915. KEY `is_faculty` (`is_faculty`) ,
  916. KEY `is_student` (`is_student`) ,
  917. KEY `school_id` (`school_id`)
  918. ); ";
  919. db_query($q);
  920. $q = "
  921. CREATE TABLE `variables` (
  922. `name` varchar(255) ,
  923. `value` longtext,
  924. PRIMARY KEY (`name`)
  925. ); ";
  926. db_query($q);
  927. $q = "
  928. CREATE TABLE `student_priority` (
  929. `student_id` varchar(30) NOT NULL,
  930. `priority_value` decimal(8,4) DEFAULT NULL,
  931. `results` longtext DEFAULT NULL,
  932. `updated` int(10) unsigned DEFAULT NULL,
  933. PRIMARY KEY (`student_id`) ,
  934. KEY `priority_value` (`priority_value`),
  935. KEY `updated` (`updated`)
  936. ); ";
  937. db_query($q);
  938. $q = "
  939. CREATE TABLE `user_attributes` (
  940. `user_id` int(11) NOT NULL,
  941. `name` varchar(255) NOT NULL,
  942. `value` longtext DEFAULT NULL,
  943. `updated` int(10) unsigned DEFAULT NULL,
  944. PRIMARY KEY (`user_id`,`name`),
  945. KEY `value` (`value`(768)),
  946. KEY `user_id` (`user_id`),
  947. KEY `name` (`name`),
  948. KEY `updated` (`updated`)
  949. ); ";
  950. db_query($q);
  951. $q = "
  952. CREATE TABLE `watchdog` (
  953. `wid` int(11) unsigned NOT NULL AUTO_INCREMENT,
  954. `user_id` int(11) unsigned DEFAULT 0,
  955. `user_name` varchar(50) DEFAULT '',
  956. `cwid` varchar(30) DEFAULT '',
  957. `type` varchar(100) DEFAULT '',
  958. `message` longtext DEFAULT NULL,
  959. `variables` longtext DEFAULT NULL,
  960. `severity` tinyint(3) unsigned DEFAULT 0,
  961. `extra_data` varchar(255) DEFAULT '',
  962. `location` longtext DEFAULT NULL,
  963. `referer` longtext DEFAULT NULL,
  964. `ip` varchar(64) DEFAULT '',
  965. `is_mobile` tinyint(4) DEFAULT 0,
  966. `is_student` tinyint(4) DEFAULT 0,
  967. `is_faculty` tinyint(4) DEFAULT 0,
  968. `timestamp` int(11) unsigned DEFAULT 0,
  969. `school_id` int(11) NOT NULL DEFAULT 0,
  970. PRIMARY KEY (`wid`),
  971. KEY `type` (`type`),
  972. KEY `uid` (`user_id`),
  973. KEY `uname` (`user_name`),
  974. KEY `severity` (`severity`),
  975. KEY `cwid` (`cwid`),
  976. KEY `timestamp` (`timestamp`),
  977. KEY `is_student` (`is_student`),
  978. KEY `is_faculty` (`is_faculty`),
  979. KEY `school_id` (`school_id`)
  980. ); ";
  981. db_query($q);
  982. }

Functions

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