Lines 468-485
CREATE TABLE collections_tracking (
Link Here
|
468 |
-- |
468 |
-- |
469 |
-- Table structure for table `courses` |
469 |
-- Table structure for table `courses` |
470 |
-- |
470 |
-- |
|
|
471 |
|
472 |
-- The courses table stores the courses created for the |
473 |
-- course reserves feature. |
474 |
|
471 |
DROP TABLE IF EXISTS courses; |
475 |
DROP TABLE IF EXISTS courses; |
472 |
CREATE TABLE `courses` ( |
476 |
CREATE TABLE `courses` ( |
473 |
`course_id` int(11) NOT NULL AUTO_INCREMENT, |
477 |
`course_id` int(11) NOT NULL AUTO_INCREMENT, |
474 |
`department` varchar(20) DEFAULT NULL, |
478 |
`department` varchar(20) DEFAULT NULL, -- Stores the authorised value DEPT |
475 |
`course_number` varchar(255) DEFAULT NULL, |
479 |
`course_number` varchar(255) DEFAULT NULL, -- An arbitrary field meant to store the "course number" assigned to a course |
476 |
`section` varchar(255) DEFAULT NULL, |
480 |
`section` varchar(255) DEFAULT NULL, -- Also arbitrary, but for the 'section' of a course. |
477 |
`course_name` varchar(255) DEFAULT NULL, |
481 |
`course_name` varchar(255) DEFAULT NULL, |
478 |
`term` varchar(20) DEFAULT NULL, |
482 |
`term` varchar(20) DEFAULT NULL, -- Stores the authorised value TERM |
479 |
`staff_note` mediumtext, |
483 |
`staff_note` mediumtext, |
480 |
`public_note` mediumtext, |
484 |
`public_note` mediumtext, |
481 |
`students_count` varchar(20) DEFAULT NULL, |
485 |
`students_count` varchar(20) DEFAULT NULL, -- Meant to be just an estimate of how many students will be taking this course/section |
482 |
`enabled` enum('yes','no') NOT NULL DEFAULT 'yes', |
486 |
`enabled` enum('yes','no') NOT NULL DEFAULT 'yes', -- Determines whether the course is active |
483 |
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
487 |
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
484 |
PRIMARY KEY (`course_id`) |
488 |
PRIMARY KEY (`course_id`) |
485 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
489 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
Lines 487-492
CREATE TABLE `courses` (
Link Here
|
487 |
-- |
491 |
-- |
488 |
-- Table structure for table `course_instructors` |
492 |
-- Table structure for table `course_instructors` |
489 |
-- |
493 |
-- |
|
|
494 |
|
495 |
-- The course instructors table links Koha borrowers to the |
496 |
-- courses they are teaching. Many instructors can teach many |
497 |
-- courses. course_instructors is just a many-to-many join table. |
498 |
|
490 |
DROP TABLE IF EXISTS course_instructors; |
499 |
DROP TABLE IF EXISTS course_instructors; |
491 |
CREATE TABLE `course_instructors` ( |
500 |
CREATE TABLE `course_instructors` ( |
492 |
`course_id` int(11) NOT NULL, |
501 |
`course_id` int(11) NOT NULL, |
Lines 498-512
CREATE TABLE `course_instructors` (
Link Here
|
498 |
-- |
507 |
-- |
499 |
-- Table structure for table `course_items` |
508 |
-- Table structure for table `course_items` |
500 |
-- |
509 |
-- |
|
|
510 |
|
511 |
-- If an item is placed on course reserve for one or more courses |
512 |
-- it will have an entry in this table. No matter how many courses an item |
513 |
-- is part of, it will only have one row in this table. |
514 |
|
501 |
DROP TABLE IF EXISTS course_items; |
515 |
DROP TABLE IF EXISTS course_items; |
502 |
CREATE TABLE `course_items` ( |
516 |
CREATE TABLE `course_items` ( |
503 |
`ci_id` int(11) NOT NULL AUTO_INCREMENT, |
517 |
`ci_id` int(11) NOT NULL AUTO_INCREMENT, |
504 |
`itemnumber` int(11) NOT NULL, |
518 |
`itemnumber` int(11) NOT NULL, -- items.itemnumber for the item on reserve |
505 |
`itype` varchar(10) DEFAULT NULL, |
519 |
`itype` varchar(10) DEFAULT NULL, -- an optional new itemtype for the item to have while on reserve |
506 |
`ccode` varchar(10) DEFAULT NULL, |
520 |
`ccode` varchar(10) DEFAULT NULL, -- an optional new category code for the item to have while on reserve |
507 |
`holdingbranch` varchar(10) DEFAULT NULL, |
521 |
`holdingbranch` varchar(10) DEFAULT NULL, -- an optional new holding branch for the item to have while on reserve |
508 |
`location` varchar(80) DEFAULT NULL, |
522 |
`location` varchar(80) DEFAULT NULL, -- an optional new shelving location for the item to have while on reseve |
509 |
`enabled` enum('yes','no') NOT NULL DEFAULT 'no', |
523 |
`enabled` enum('yes','no') NOT NULL DEFAULT 'no', -- If at least one enabled course has this item on reseve, this field will be 'yes', otherwise it will be 'no' |
510 |
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
524 |
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
511 |
PRIMARY KEY (`ci_id`), |
525 |
PRIMARY KEY (`ci_id`), |
512 |
UNIQUE KEY `itemnumber` (`itemnumber`) |
526 |
UNIQUE KEY `itemnumber` (`itemnumber`) |
Lines 515-527
CREATE TABLE `course_items` (
Link Here
|
515 |
-- |
529 |
-- |
516 |
-- Table structure for table `course_reserves` |
530 |
-- Table structure for table `course_reserves` |
517 |
-- |
531 |
-- |
|
|
532 |
|
533 |
-- This table connects an item placed on course reserve to a course it is on reserve for. |
534 |
-- There will be a row in this table for each course an item is on reserve for. |
535 |
|
518 |
DROP TABLE IF EXISTS course_reserves; |
536 |
DROP TABLE IF EXISTS course_reserves; |
519 |
CREATE TABLE `course_reserves` ( |
537 |
CREATE TABLE `course_reserves` ( |
520 |
`cr_id` int(11) NOT NULL AUTO_INCREMENT, |
538 |
`cr_id` int(11) NOT NULL AUTO_INCREMENT, |
521 |
`course_id` int(11) NOT NULL, |
539 |
`course_id` int(11) NOT NULL, -- Foreign key to the courses table |
522 |
`ci_id` int(11) NOT NULL, |
540 |
`ci_id` int(11) NOT NULL, -- Foreign key to the course_items table |
523 |
`staff_note` mediumtext, |
541 |
`staff_note` mediumtext, -- Staff only note |
524 |
`public_note` mediumtext, |
542 |
`public_note` mediumtext, -- Public, OPAC visible note |
525 |
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
543 |
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
526 |
PRIMARY KEY (`cr_id`), |
544 |
PRIMARY KEY (`cr_id`), |
527 |
UNIQUE KEY `psuedo_key` (`course_id`,`ci_id`), |
545 |
UNIQUE KEY `psuedo_key` (`course_id`,`ci_id`), |