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