Lines 3952-3957
CREATE TABLE deletedbiblio_metadata (
Link Here
|
3952 |
CONSTRAINT `deletedrecord_metadata_fk_1` FOREIGN KEY (biblionumber) REFERENCES deletedbiblio (biblionumber) ON DELETE CASCADE ON UPDATE CASCADE |
3952 |
CONSTRAINT `deletedrecord_metadata_fk_1` FOREIGN KEY (biblionumber) REFERENCES deletedbiblio (biblionumber) ON DELETE CASCADE ON UPDATE CASCADE |
3953 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
3953 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
3954 |
|
3954 |
|
|
|
3955 |
-- |
3956 |
-- Table structure for table 'club_templates' |
3957 |
-- |
3958 |
|
3959 |
CREATE TABLE IF NOT EXISTS club_templates ( |
3960 |
id int(11) NOT NULL AUTO_INCREMENT, |
3961 |
`name` tinytext NOT NULL, |
3962 |
description text, |
3963 |
is_enrollable_from_opac tinyint(1) NOT NULL DEFAULT '0', |
3964 |
is_email_required tinyint(1) NOT NULL DEFAULT '0', |
3965 |
`branchcode` varchar(10) COLLATE utf8_unicode_ci NULL DEFAULT NULL, |
3966 |
date_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
3967 |
date_updated timestamp NULL DEFAULT NULL, |
3968 |
is_deletable tinyint(1) NOT NULL DEFAULT '1', |
3969 |
PRIMARY KEY (id), |
3970 |
KEY ct_branchcode (branchcode), |
3971 |
CONSTRAINT `club_templates_ibfk_1` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE |
3972 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
3973 |
|
3974 |
-- |
3975 |
-- Table structure for table 'clubs' |
3976 |
-- |
3977 |
|
3978 |
CREATE TABLE IF NOT EXISTS clubs ( |
3979 |
id int(11) NOT NULL AUTO_INCREMENT, |
3980 |
club_template_id int(11) NOT NULL, |
3981 |
`name` tinytext NOT NULL, |
3982 |
description text, |
3983 |
date_start date DEFAULT NULL, |
3984 |
date_end date DEFAULT NULL, |
3985 |
`branchcode` varchar(10) COLLATE utf8_unicode_ci NULL DEFAULT NULL, |
3986 |
date_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
3987 |
date_updated timestamp NULL DEFAULT NULL, |
3988 |
PRIMARY KEY (id), |
3989 |
KEY club_template_id (club_template_id), |
3990 |
KEY branchcode (branchcode), |
3991 |
CONSTRAINT clubs_ibfk_1 FOREIGN KEY (club_template_id) REFERENCES club_templates (id) ON DELETE CASCADE ON UPDATE CASCADE, |
3992 |
CONSTRAINT clubs_ibfk_2 FOREIGN KEY (branchcode) REFERENCES branches (branchcode) |
3993 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
3994 |
|
3995 |
-- |
3996 |
-- Table structure for table 'club_enrollments' |
3997 |
-- |
3998 |
|
3999 |
CREATE TABLE IF NOT EXISTS club_enrollments ( |
4000 |
id int(11) NOT NULL AUTO_INCREMENT, |
4001 |
club_id int(11) NOT NULL, |
4002 |
borrowernumber int(11) NOT NULL, |
4003 |
date_enrolled timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
4004 |
date_canceled timestamp NULL DEFAULT NULL, |
4005 |
date_created timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', |
4006 |
date_updated timestamp NULL DEFAULT NULL, |
4007 |
`branchcode` varchar(10) COLLATE utf8_unicode_ci NULL DEFAULT NULL, |
4008 |
PRIMARY KEY (id), |
4009 |
KEY club_id (club_id), |
4010 |
KEY borrowernumber (borrowernumber), |
4011 |
KEY branchcode (branchcode), |
4012 |
CONSTRAINT club_enrollments_ibfk_1 FOREIGN KEY (club_id) REFERENCES clubs (id) ON DELETE CASCADE ON UPDATE CASCADE, |
4013 |
CONSTRAINT club_enrollments_ibfk_2 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE, |
4014 |
CONSTRAINT club_enrollments_ibfk_3 FOREIGN KEY (branchcode) REFERENCES branches (branchcode) ON DELETE SET NULL ON UPDATE CASCADE |
4015 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
4016 |
|
4017 |
-- |
4018 |
-- Table structure for table 'club_template_enrollment_fields' |
4019 |
-- |
4020 |
|
4021 |
CREATE TABLE IF NOT EXISTS club_template_enrollment_fields ( |
4022 |
id int(11) NOT NULL AUTO_INCREMENT, |
4023 |
club_template_id int(11) NOT NULL, |
4024 |
`name` tinytext NOT NULL, |
4025 |
description text, |
4026 |
authorised_value_category varchar(16) DEFAULT NULL, |
4027 |
PRIMARY KEY (id), |
4028 |
KEY club_template_id (club_template_id), |
4029 |
CONSTRAINT club_template_enrollment_fields_ibfk_1 FOREIGN KEY (club_template_id) REFERENCES club_templates (id) ON DELETE CASCADE ON UPDATE CASCADE |
4030 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
4031 |
|
4032 |
-- |
4033 |
-- Table structure for table 'club_enrollment_fields' |
4034 |
-- |
4035 |
|
4036 |
CREATE TABLE IF NOT EXISTS club_enrollment_fields ( |
4037 |
id int(11) NOT NULL AUTO_INCREMENT, |
4038 |
club_enrollment_id int(11) NOT NULL, |
4039 |
club_template_enrollment_field_id int(11) NOT NULL, |
4040 |
`value` text NOT NULL, |
4041 |
PRIMARY KEY (id), |
4042 |
KEY club_enrollment_id (club_enrollment_id), |
4043 |
KEY club_template_enrollment_field_id (club_template_enrollment_field_id), |
4044 |
CONSTRAINT club_enrollment_fields_ibfk_1 FOREIGN KEY (club_enrollment_id) REFERENCES club_enrollments (id) ON DELETE CASCADE ON UPDATE CASCADE, |
4045 |
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 |
4046 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
4047 |
|
4048 |
-- |
4049 |
-- Table structure for table 'club_template_fields' |
4050 |
-- |
4051 |
|
4052 |
CREATE TABLE IF NOT EXISTS club_template_fields ( |
4053 |
id int(11) NOT NULL AUTO_INCREMENT, |
4054 |
club_template_id int(11) NOT NULL, |
4055 |
`name` tinytext NOT NULL, |
4056 |
description text, |
4057 |
authorised_value_category varchar(16) DEFAULT NULL, |
4058 |
PRIMARY KEY (id), |
4059 |
KEY club_template_id (club_template_id), |
4060 |
CONSTRAINT club_template_fields_ibfk_1 FOREIGN KEY (club_template_id) REFERENCES club_templates (id) ON DELETE CASCADE ON UPDATE CASCADE |
4061 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
4062 |
|
4063 |
-- |
4064 |
-- Table structure for table 'club_fields' |
4065 |
-- |
4066 |
|
4067 |
CREATE TABLE IF NOT EXISTS club_fields ( |
4068 |
id int(11) NOT NULL AUTO_INCREMENT, |
4069 |
club_template_field_id int(11) NOT NULL, |
4070 |
club_id int(11) NOT NULL, |
4071 |
`value` text, |
4072 |
PRIMARY KEY (id), |
4073 |
KEY club_template_field_id (club_template_field_id), |
4074 |
KEY club_id (club_id), |
4075 |
CONSTRAINT club_fields_ibfk_3 FOREIGN KEY (club_template_field_id) REFERENCES club_template_fields (id) ON DELETE CASCADE ON UPDATE CASCADE, |
4076 |
CONSTRAINT club_fields_ibfk_4 FOREIGN KEY (club_id) REFERENCES clubs (id) ON DELETE CASCADE ON UPDATE CASCADE |
4077 |
>>>>>>> Bug 12461 - Add patron clubs feature |
4078 |
>>>>>>> Bug 12461 - Add patron clubs feature |
4079 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
4080 |
|
3955 |
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; |
4081 |
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; |
3956 |
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; |
4082 |
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; |
3957 |
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; |
4083 |
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; |