prereqs.install

  1. 7.x modules/prereqs/prereqs.install
  2. 6.x modules/prereqs/prereqs.install

Install file for the prereqs module

File

modules/prereqs/prereqs.install
View source
  1. <?php
  2. /**
  3. * @file
  4. * Install file for the prereqs module
  5. */
  6. /**
  7. * hook_install.
  8. *
  9. * Create our database table.
  10. */
  11. function prereqs_install() {
  12. $q = "
  13. CREATE TABLE `prereqs_prereqs` (
  14. `course_id` int(11) DEFAULT '0',
  15. `prereq_data` text,
  16. KEY `course_id` (`course_id`)
  17. );
  18. ";
  19. db_query($q);
  20. fp_add_message(t("Database table created for prereqs module."));
  21. }
  22. function prereqs_update($old_schema, $new_schema) {
  23. if (intval($old_schema) < 2) {
  24. db_query("ALTER TABLE prereqs_prereqs MODIFY prereq_data LONGTEXT");
  25. fpm("Altered prereqs table to change TEXT to LONGTEXT.");
  26. }
  27. }

Functions

Namesort descending Description
prereqs_install hook_install.
prereqs_update