Lines 530-545
CREATE TABLE collections_tracking (
Link Here
|
530 |
|
530 |
|
531 |
DROP TABLE IF EXISTS courses; |
531 |
DROP TABLE IF EXISTS courses; |
532 |
CREATE TABLE `courses` ( |
532 |
CREATE TABLE `courses` ( |
533 |
`course_id` int(11) NOT NULL AUTO_INCREMENT, |
533 |
`course_id` int(11) NOT NULL AUTO_INCREMENT, -- unique id for the course |
534 |
`department` varchar(80) DEFAULT NULL, -- Stores the authorised value DEPT |
534 |
`department` varchar(80) DEFAULT NULL, -- the authorised value for the DEPARTMENT |
535 |
`course_number` varchar(255) DEFAULT NULL, -- An arbitrary field meant to store the "course number" assigned to a course |
535 |
`course_number` varchar(255) DEFAULT NULL, -- the "course number" assigned to a course |
536 |
`section` varchar(255) DEFAULT NULL, -- Also arbitrary, but for the 'section' of a course. |
536 |
`section` varchar(255) DEFAULT NULL, -- the 'section' of a course |
537 |
`course_name` varchar(255) DEFAULT NULL, |
537 |
`course_name` varchar(255) DEFAULT NULL, -- the name of the course |
538 |
`term` varchar(80) DEFAULT NULL, -- Stores the authorised value TERM |
538 |
`term` varchar(80) DEFAULT NULL, -- the authorised value for the TERM |
539 |
`staff_note` mediumtext, |
539 |
`staff_note` mediumtext, -- the text of the staff only note |
540 |
`public_note` mediumtext, |
540 |
`public_note` mediumtext, -- the text of the public / opac note |
541 |
`students_count` varchar(20) DEFAULT NULL, -- Meant to be just an estimate of how many students will be taking this course/section |
541 |
`students_count` varchar(20) DEFAULT NULL, -- how many students will be taking this course/section |
542 |
`enabled` enum('yes','no') NOT NULL DEFAULT 'yes', -- Determines whether the course is active |
542 |
`enabled` enum('yes','no') NOT NULL DEFAULT 'yes', -- determines whether the course is active |
543 |
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
543 |
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
544 |
PRIMARY KEY (`course_id`) |
544 |
PRIMARY KEY (`course_id`) |
545 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
545 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
Lines 554-561
CREATE TABLE `courses` (
Link Here
|
554 |
|
554 |
|
555 |
DROP TABLE IF EXISTS course_instructors; |
555 |
DROP TABLE IF EXISTS course_instructors; |
556 |
CREATE TABLE `course_instructors` ( |
556 |
CREATE TABLE `course_instructors` ( |
557 |
`course_id` int(11) NOT NULL, |
557 |
`course_id` int(11) NOT NULL, -- foreign key to link to courses.course_id |
558 |
`borrowernumber` int(11) NOT NULL, |
558 |
`borrowernumber` int(11) NOT NULL, -- foreign key to link to borrowers.borrowernumber for instructor information |
559 |
PRIMARY KEY (`course_id`,`borrowernumber`), |
559 |
PRIMARY KEY (`course_id`,`borrowernumber`), |
560 |
KEY `borrowernumber` (`borrowernumber`) |
560 |
KEY `borrowernumber` (`borrowernumber`) |
561 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
561 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
Lines 577-589
ALTER TABLE `course_instructors`
Link Here
|
577 |
|
577 |
|
578 |
DROP TABLE IF EXISTS course_items; |
578 |
DROP TABLE IF EXISTS course_items; |
579 |
CREATE TABLE `course_items` ( |
579 |
CREATE TABLE `course_items` ( |
580 |
`ci_id` int(11) NOT NULL AUTO_INCREMENT, |
580 |
`ci_id` int(11) NOT NULL AUTO_INCREMENT, -- course item id |
581 |
`itemnumber` int(11) NOT NULL, -- items.itemnumber for the item on reserve |
581 |
`itemnumber` int(11) NOT NULL, -- items.itemnumber for the item on reserve |
582 |
`itype` varchar(10) DEFAULT NULL, -- an optional new itemtype for the item to have while on reserve |
582 |
`itype` varchar(10) DEFAULT NULL, -- new itemtype for the item to have while on reserve (optional) |
583 |
`ccode` varchar(10) DEFAULT NULL, -- an optional new category code for the item to have while on reserve |
583 |
`ccode` varchar(10) DEFAULT NULL, -- new category code for the item to have while on reserve (optional) |
584 |
`holdingbranch` varchar(10) DEFAULT NULL, -- an optional new holding branch for the item to have while on reserve |
584 |
`holdingbranch` varchar(10) DEFAULT NULL, -- new holding branch for the item to have while on reserve (optional) |
585 |
`location` varchar(80) DEFAULT NULL, -- an optional new shelving location for the item to have while on reseve |
585 |
`location` varchar(80) DEFAULT NULL, -- new shelving location for the item to have while on reseve (optional) |
586 |
`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' |
586 |
`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' |
587 |
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
587 |
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
588 |
PRIMARY KEY (`ci_id`), |
588 |
PRIMARY KEY (`ci_id`), |
589 |
UNIQUE KEY `itemnumber` (`itemnumber`), |
589 |
UNIQUE KEY `itemnumber` (`itemnumber`), |
Lines 607-616
ALTER TABLE `course_items`
Link Here
|
607 |
DROP TABLE IF EXISTS course_reserves; |
607 |
DROP TABLE IF EXISTS course_reserves; |
608 |
CREATE TABLE `course_reserves` ( |
608 |
CREATE TABLE `course_reserves` ( |
609 |
`cr_id` int(11) NOT NULL AUTO_INCREMENT, |
609 |
`cr_id` int(11) NOT NULL AUTO_INCREMENT, |
610 |
`course_id` int(11) NOT NULL, -- Foreign key to the courses table |
610 |
`course_id` int(11) NOT NULL, -- foreign key to link to courses.course_id |
611 |
`ci_id` int(11) NOT NULL, -- Foreign key to the course_items table |
611 |
`ci_id` int(11) NOT NULL, -- foreign key to link to courses_items.ci_id |
612 |
`staff_note` mediumtext, -- Staff only note |
612 |
`staff_note` mediumtext, -- staff only note |
613 |
`public_note` mediumtext, -- Public, OPAC visible note |
613 |
`public_note` mediumtext, -- public, OPAC visible note |
614 |
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
614 |
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
615 |
PRIMARY KEY (`cr_id`), |
615 |
PRIMARY KEY (`cr_id`), |
616 |
UNIQUE KEY `pseudo_key` (`course_id`,`ci_id`), |
616 |
UNIQUE KEY `pseudo_key` (`course_id`,`ci_id`), |
617 |
- |
|
|