schools.install

This is the install file for the Schools module. Here, we will handle installing the tables associated with this module.

File

modules/schools/schools.install
View source
  1. <?php
  2. /**
  3. * @file
  4. *
  5. * This is the install file for the Schools module. Here, we will handle installing the tables
  6. * associated with this module.
  7. */
  8. /**
  9. * Implements hook_install
  10. *
  11. * This function will create our tables.
  12. *
  13. */
  14. function schools_install() {
  15. $q = "
  16. CREATE TABLE `schools` (
  17. `school_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  18. `school_code` varchar(5) NOT NULL,
  19. `name` varchar(255) NOT NULL,
  20. PRIMARY KEY (`school_id`),
  21. KEY `name` (`name`),
  22. KEY `school_code` (`school_code`)
  23. ); ";
  24. db_query($q);
  25. } // hook_install

Functions

Namesort descending Description
schools_install Implements hook_install