Lines 3559-3564
CREATE TABLE `additional_field_values` (
Link Here
|
3559 |
CONSTRAINT `afv_fk` FOREIGN KEY (`field_id`) REFERENCES `additional_fields` (`id`) ON DELETE CASCADE ON UPDATE CASCADE |
3559 |
CONSTRAINT `afv_fk` FOREIGN KEY (`field_id`) REFERENCES `additional_fields` (`id`) ON DELETE CASCADE ON UPDATE CASCADE |
3560 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
3560 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
3561 |
|
3561 |
|
|
|
3562 |
-- |
3563 |
-- Table structure for table 'club_templates' |
3564 |
-- |
3565 |
|
3566 |
CREATE TABLE IF NOT EXISTS club_templates ( |
3567 |
id int(11) NOT NULL AUTO_INCREMENT, |
3568 |
`name` tinytext NOT NULL, |
3569 |
description text, |
3570 |
is_enrollable_from_opac tinyint(1) NOT NULL DEFAULT '0', |
3571 |
is_email_required tinyint(1) NOT NULL DEFAULT '0', |
3572 |
`branchcode` varchar(10) COLLATE utf8_unicode_ci NULL DEFAULT NULL, |
3573 |
date_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
3574 |
date_updated timestamp NULL DEFAULT NULL, |
3575 |
is_deletable tinyint(1) NOT NULL DEFAULT '1', |
3576 |
PRIMARY KEY (id), |
3577 |
KEY ct_branchcode (branchcode), |
3578 |
CONSTRAINT `club_templates_ibfk_1` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE |
3579 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
3580 |
|
3581 |
-- |
3582 |
-- Table structure for table 'clubs' |
3583 |
-- |
3584 |
|
3585 |
CREATE TABLE IF NOT EXISTS clubs ( |
3586 |
id int(11) NOT NULL AUTO_INCREMENT, |
3587 |
club_template_id int(11) NOT NULL, |
3588 |
`name` tinytext NOT NULL, |
3589 |
description text, |
3590 |
date_start date DEFAULT NULL, |
3591 |
date_end date DEFAULT NULL, |
3592 |
`branchcode` varchar(10) COLLATE utf8_unicode_ci NULL DEFAULT NULL, |
3593 |
date_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
3594 |
date_updated timestamp NULL DEFAULT NULL, |
3595 |
PRIMARY KEY (id), |
3596 |
KEY club_template_id (club_template_id), |
3597 |
KEY branchcode (branchcode), |
3598 |
CONSTRAINT clubs_ibfk_1 FOREIGN KEY (club_template_id) REFERENCES club_templates (id) ON DELETE CASCADE ON UPDATE CASCADE, |
3599 |
CONSTRAINT clubs_ibfk_2 FOREIGN KEY (branchcode) REFERENCES branches (branchcode) |
3600 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
3601 |
|
3602 |
-- |
3603 |
-- Table structure for table 'club_enrollments' |
3604 |
-- |
3605 |
|
3606 |
CREATE TABLE IF NOT EXISTS club_enrollments ( |
3607 |
id int(11) NOT NULL AUTO_INCREMENT, |
3608 |
club_id int(11) NOT NULL, |
3609 |
borrowernumber int(11) NOT NULL, |
3610 |
date_enrolled timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
3611 |
date_canceled timestamp NULL DEFAULT NULL, |
3612 |
date_created timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', |
3613 |
date_updated timestamp NULL DEFAULT NULL, |
3614 |
`branchcode` varchar(10) COLLATE utf8_unicode_ci NULL DEFAULT NULL, |
3615 |
PRIMARY KEY (id), |
3616 |
KEY club_id (club_id), |
3617 |
KEY borrowernumber (borrowernumber), |
3618 |
KEY branchcode (branchcode), |
3619 |
CONSTRAINT club_enrollments_ibfk_1 FOREIGN KEY (club_id) REFERENCES clubs (id) ON DELETE CASCADE ON UPDATE CASCADE, |
3620 |
CONSTRAINT club_enrollments_ibfk_2 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE, |
3621 |
CONSTRAINT club_enrollments_ibfk_3 FOREIGN KEY (branchcode) REFERENCES branches (branchcode) ON DELETE SET NULL ON UPDATE CASCADE |
3622 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
3623 |
|
3624 |
-- |
3625 |
-- Table structure for table 'club_template_enrollment_fields' |
3626 |
-- |
3627 |
|
3628 |
CREATE TABLE IF NOT EXISTS club_template_enrollment_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 |
CONSTRAINT club_template_enrollment_fields_ibfk_1 FOREIGN KEY (club_template_id) REFERENCES club_templates (id) ON DELETE CASCADE ON UPDATE CASCADE |
3637 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
3638 |
|
3639 |
-- |
3640 |
-- Table structure for table 'club_enrollment_fields' |
3641 |
-- |
3642 |
|
3643 |
CREATE TABLE IF NOT EXISTS club_enrollment_fields ( |
3644 |
id int(11) NOT NULL AUTO_INCREMENT, |
3645 |
club_enrollment_id int(11) NOT NULL, |
3646 |
club_template_enrollment_field_id int(11) NOT NULL, |
3647 |
`value` text NOT NULL, |
3648 |
PRIMARY KEY (id), |
3649 |
KEY club_enrollment_id (club_enrollment_id), |
3650 |
KEY club_template_enrollment_field_id (club_template_enrollment_field_id), |
3651 |
CONSTRAINT club_enrollment_fields_ibfk_1 FOREIGN KEY (club_enrollment_id) REFERENCES club_enrollments (id) ON DELETE CASCADE ON UPDATE CASCADE, |
3652 |
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 |
3653 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
3654 |
|
3655 |
-- |
3656 |
-- Table structure for table 'club_template_fields' |
3657 |
-- |
3658 |
|
3659 |
CREATE TABLE IF NOT EXISTS club_template_fields ( |
3660 |
id int(11) NOT NULL AUTO_INCREMENT, |
3661 |
club_template_id int(11) NOT NULL, |
3662 |
`name` tinytext NOT NULL, |
3663 |
description text, |
3664 |
authorised_value_category varchar(16) DEFAULT NULL, |
3665 |
PRIMARY KEY (id), |
3666 |
KEY club_template_id (club_template_id), |
3667 |
CONSTRAINT club_template_fields_ibfk_1 FOREIGN KEY (club_template_id) REFERENCES club_templates (id) ON DELETE CASCADE ON UPDATE CASCADE |
3668 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
3669 |
|
3670 |
-- |
3671 |
-- Table structure for table 'club_fields' |
3672 |
-- |
3673 |
|
3674 |
CREATE TABLE IF NOT EXISTS club_fields ( |
3675 |
id int(11) NOT NULL AUTO_INCREMENT, |
3676 |
club_template_field_id int(11) NOT NULL, |
3677 |
club_id int(11) NOT NULL, |
3678 |
`value` text, |
3679 |
PRIMARY KEY (id), |
3680 |
KEY club_template_field_id (club_template_field_id), |
3681 |
KEY club_id (club_id), |
3682 |
CONSTRAINT club_fields_ibfk_3 FOREIGN KEY (club_template_field_id) REFERENCES club_template_fields (id) ON DELETE CASCADE ON UPDATE CASCADE, |
3683 |
CONSTRAINT club_fields_ibfk_4 FOREIGN KEY (club_id) REFERENCES clubs (id) ON DELETE CASCADE ON UPDATE CASCADE |
3684 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
3685 |
|
3562 |
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; |
3686 |
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; |
3563 |
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; |
3687 |
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; |
3564 |
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; |
3688 |
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; |