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