audit.install

This is the install file for the audit module.

The primary thing we want to do is create the database table.

File

modules/audit/audit.install
View source
  1. <?php
  2. /**
  3. * @file
  4. * This is the install file for the audit module.
  5. *
  6. * The primary thing we want to do is create the database table.
  7. */
  8. /**
  9. * Implementation of hook_install.
  10. *
  11. */
  12. function audit_install() {
  13. if (!db_table_exists("audit_approvals")) {
  14. // Create it.
  15. db_query("CREATE TABLE `audit_approvals` (
  16. `aid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  17. `student_id` varchar(30) DEFAULT '0',
  18. `uid` int(11) DEFAULT 0,
  19. `faculty_id` varchar(30) DEFAULT '0',
  20. `approval_type` varchar(60) DEFAULT '',
  21. `approval_value` varchar(40) DEFAULT '',
  22. `posted` int(10) unsigned NOT NULL,
  23. PRIMARY KEY (`aid`),
  24. KEY `student_id` (`student_id`),
  25. KEY `faculty_id` (`faculty_id`),
  26. KEY `approval_type` (`approval_type`),
  27. KEY `approval_value` (`approval_value`),
  28. KEY `posted` (`posted`),
  29. KEY `uid` (`uid`)
  30. ); ");
  31. }
  32. }

Functions

Namesort descending Description
audit_install Implementation of hook_install.