Lines 3504-3509
CREATE TABLE items_search_fields (
Link Here
|
3504 |
ON DELETE SET NULL ON UPDATE CASCADE |
3504 |
ON DELETE SET NULL ON UPDATE CASCADE |
3505 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
3505 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
3506 |
|
3506 |
|
|
|
3507 |
-- |
3508 |
-- Table structure for table 'clubs' |
3509 |
-- |
3510 |
|
3511 |
DROP TABLE IF EXISTS clubs; |
3512 |
CREATE TABLE IF NOT EXISTS clubs ( |
3513 |
id int(11) NOT NULL AUTO_INCREMENT, |
3514 |
club_template_id int(11) NOT NULL, |
3515 |
`name` tinytext NOT NULL, |
3516 |
description text, |
3517 |
date_start date DEFAULT NULL, |
3518 |
date_end date DEFAULT NULL, |
3519 |
branchcode varchar(11) DEFAULT NULL, |
3520 |
date_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
3521 |
date_updated timestamp NULL DEFAULT NULL, |
3522 |
PRIMARY KEY (id), |
3523 |
KEY club_template_id (club_template_id), |
3524 |
KEY branchcode (branchcode) |
3525 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
3526 |
|
3527 |
-- -------------------------------------------------------- |
3528 |
|
3529 |
-- |
3530 |
-- Table structure for table 'club_enrollments' |
3531 |
-- |
3532 |
|
3533 |
DROP TABLE IF EXISTS club_enrollments; |
3534 |
CREATE TABLE IF NOT EXISTS club_enrollments ( |
3535 |
id int(11) NOT NULL AUTO_INCREMENT, |
3536 |
club_id int(11) NOT NULL, |
3537 |
borrowernumber int(11) NOT NULL, |
3538 |
date_enrolled timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
3539 |
date_canceled timestamp NULL DEFAULT NULL, |
3540 |
date_created timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', |
3541 |
date_updated timestamp NULL DEFAULT NULL, |
3542 |
branchcode varchar(11) DEFAULT NULL, |
3543 |
PRIMARY KEY (id), |
3544 |
KEY club_id (club_id), |
3545 |
KEY borrowernumber (borrowernumber), |
3546 |
KEY branchcode (branchcode) |
3547 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
3548 |
|
3549 |
-- -------------------------------------------------------- |
3550 |
|
3551 |
-- |
3552 |
-- Table structure for table 'club_enrollment_fields' |
3553 |
-- |
3554 |
|
3555 |
DROP TABLE IF EXISTS club_enrollment_fields; |
3556 |
CREATE TABLE IF NOT EXISTS club_enrollment_fields ( |
3557 |
id int(11) NOT NULL AUTO_INCREMENT, |
3558 |
club_enrollment_id int(11) NOT NULL, |
3559 |
club_template_enrollment_field_id int(11) NOT NULL, |
3560 |
`value` text NOT NULL, |
3561 |
PRIMARY KEY (id), |
3562 |
KEY club_enrollment_id (club_enrollment_id), |
3563 |
KEY club_template_enrollment_field_id (club_template_enrollment_field_id) |
3564 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
3565 |
|
3566 |
-- -------------------------------------------------------- |
3567 |
|
3568 |
-- |
3569 |
-- Table structure for table 'club_fields' |
3570 |
-- |
3571 |
|
3572 |
DROP TABLE IF EXISTS club_fields; |
3573 |
CREATE TABLE IF NOT EXISTS club_fields ( |
3574 |
id int(11) NOT NULL AUTO_INCREMENT, |
3575 |
club_template_field_id int(11) NOT NULL, |
3576 |
club_id int(11) NOT NULL, |
3577 |
`value` text, |
3578 |
PRIMARY KEY (id), |
3579 |
KEY club_template_field_id (club_template_field_id), |
3580 |
KEY club_id (club_id) |
3581 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
3582 |
|
3583 |
-- -------------------------------------------------------- |
3584 |
|
3585 |
-- |
3586 |
-- Table structure for table 'club_templates' |
3587 |
-- |
3588 |
|
3589 |
DROP TABLE IF EXISTS club_templates; |
3590 |
CREATE TABLE IF NOT EXISTS club_templates ( |
3591 |
id int(11) NOT NULL AUTO_INCREMENT, |
3592 |
`name` tinytext NOT NULL, |
3593 |
description text, |
3594 |
is_enrollable_from_opac tinyint(1) NOT NULL DEFAULT '0', |
3595 |
is_email_required tinyint(1) NOT NULL DEFAULT '0', |
3596 |
branchcode varchar(10) DEFAULT NULL, |
3597 |
date_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
3598 |
date_updated timestamp NULL DEFAULT NULL, |
3599 |
is_deletable tinyint(1) NOT NULL DEFAULT '1', |
3600 |
PRIMARY KEY (id), |
3601 |
KEY branchcode (branchcode) |
3602 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
3603 |
|
3604 |
-- -------------------------------------------------------- |
3605 |
|
3606 |
-- |
3607 |
-- Table structure for table 'club_template_enrollment_fields' |
3608 |
-- |
3609 |
|
3610 |
DROP TABLE IF EXISTS club_template_enrollment_fields; |
3611 |
CREATE TABLE IF NOT EXISTS club_template_enrollment_fields ( |
3612 |
id int(11) NOT NULL AUTO_INCREMENT, |
3613 |
club_template_id int(11) NOT NULL, |
3614 |
`name` tinytext NOT NULL, |
3615 |
description text, |
3616 |
authorised_value_category varchar(16) DEFAULT NULL, |
3617 |
PRIMARY KEY (id), |
3618 |
KEY club_template_id (club_template_id) |
3619 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
3620 |
|
3621 |
-- -------------------------------------------------------- |
3622 |
|
3623 |
-- |
3624 |
-- Table structure for table 'club_template_fields' |
3625 |
-- |
3626 |
|
3627 |
DROP TABLE IF EXISTS club_template_fields; |
3628 |
CREATE TABLE IF NOT EXISTS club_template_fields ( |
3629 |
id int(11) NOT NULL AUTO_INCREMENT, |
3630 |
club_template_id int(11) NOT NULL, |
3631 |
`name` tinytext NOT NULL, |
3632 |
description text, |
3633 |
authorised_value_category varchar(16) DEFAULT NULL, |
3634 |
PRIMARY KEY (id), |
3635 |
KEY club_template_id (club_template_id) |
3636 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
3637 |
|
3638 |
-- |
3639 |
-- Constraints for table `clubs` |
3640 |
-- |
3641 |
ALTER TABLE `clubs` |
3642 |
ADD CONSTRAINT clubs_ibfk_1 FOREIGN KEY (club_template_id) REFERENCES club_templates (id) ON DELETE CASCADE ON UPDATE CASCADE, |
3643 |
ADD CONSTRAINT clubs_ibfk_2 FOREIGN KEY (branchcode) REFERENCES branches (branchcode); |
3644 |
|
3645 |
-- |
3646 |
-- Constraints for table `club_enrollments` |
3647 |
-- |
3648 |
ALTER TABLE `club_enrollments` |
3649 |
ADD CONSTRAINT club_enrollments_ibfk_1 FOREIGN KEY (club_id) REFERENCES clubs (id) ON DELETE CASCADE ON UPDATE CASCADE, |
3650 |
ADD CONSTRAINT club_enrollments_ibfk_2 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE, |
3651 |
ADD CONSTRAINT club_enrollments_ibfk_3 FOREIGN KEY (branchcode) REFERENCES branches (branchcode) ON DELETE SET NULL ON UPDATE CASCADE; |
3652 |
|
3653 |
-- |
3654 |
-- Constraints for table `club_enrollment_fields` |
3655 |
-- |
3656 |
ALTER TABLE `club_enrollment_fields` |
3657 |
ADD CONSTRAINT club_enrollment_fields_ibfk_1 FOREIGN KEY (club_enrollment_id) REFERENCES club_enrollments (id) ON DELETE CASCADE ON UPDATE CASCADE, |
3658 |
ADD CONSTRAINT club_enrollment_fields_ibfk_2 FOREIGN KEY (club_template_enrollment_field_id) REFERENCES club_template_enrollment_fields (id) ON DELETE CASCADE ON UPDATE CASCADE; |
3659 |
|
3660 |
-- |
3661 |
-- Constraints for table `club_fields` |
3662 |
-- |
3663 |
ALTER TABLE `club_fields` |
3664 |
ADD CONSTRAINT club_fields_ibfk_3 FOREIGN KEY (club_template_field_id) REFERENCES club_template_fields (id) ON DELETE CASCADE ON UPDATE CASCADE, |
3665 |
ADD CONSTRAINT club_fields_ibfk_4 FOREIGN KEY (club_id) REFERENCES clubs (id) ON DELETE CASCADE ON UPDATE CASCADE; |
3666 |
|
3667 |
-- |
3668 |
-- Constraints for table `club_templates` |
3669 |
-- |
3670 |
ALTER TABLE `club_templates` |
3671 |
ADD CONSTRAINT club_templates_ibfk_1 FOREIGN KEY (branchcode) REFERENCES branches (branchcode) ON DELETE SET NULL ON UPDATE CASCADE; |
3672 |
|
3673 |
-- |
3674 |
-- Constraints for table `club_template_enrollment_fields` |
3675 |
-- |
3676 |
ALTER TABLE `club_template_enrollment_fields` |
3677 |
ADD CONSTRAINT club_template_enrollment_fields_ibfk_1 FOREIGN KEY (club_template_id) REFERENCES club_templates (id) ON DELETE CASCADE ON UPDATE CASCADE; |
3678 |
|
3679 |
-- |
3680 |
-- Constraints for table `club_template_fields` |
3681 |
-- |
3682 |
ALTER TABLE `club_template_fields` |
3683 |
ADD CONSTRAINT club_template_fields_ibfk_1 FOREIGN KEY (club_template_id) REFERENCES club_templates (id) ON DELETE CASCADE ON UPDATE CASCADE; |
3684 |
|
3507 |
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; |
3685 |
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; |
3508 |
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; |
3686 |
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; |
3509 |
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; |
3687 |
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; |