Lines 8-20
CREATE TABLE IF NOT EXISTS club_templates (
Link Here
|
8 |
description text, |
8 |
description text, |
9 |
is_enrollable_from_opac tinyint(1) NOT NULL DEFAULT '0', |
9 |
is_enrollable_from_opac tinyint(1) NOT NULL DEFAULT '0', |
10 |
is_email_required tinyint(1) NOT NULL DEFAULT '0', |
10 |
is_email_required tinyint(1) NOT NULL DEFAULT '0', |
11 |
`branchcode` varchar(10) COLLATE utf8_unicode_ci NULL DEFAULT NULL, |
11 |
branchcode varchar(10) NULL DEFAULT NULL, |
12 |
date_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
12 |
date_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
13 |
date_updated timestamp NULL DEFAULT NULL, |
13 |
date_updated timestamp NULL DEFAULT NULL, |
14 |
is_deletable tinyint(1) NOT NULL DEFAULT '1', |
14 |
is_deletable tinyint(1) NOT NULL DEFAULT '1', |
15 |
PRIMARY KEY (id), |
15 |
PRIMARY KEY (id), |
16 |
KEY ct_branchcode (branchcode), |
16 |
KEY ct_branchcode (branchcode), |
17 |
CONSTRAINT `club_templates_ibfk_1` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE |
17 |
CONSTRAINT `club_templates_ibfk_1` FOREIGN KEY (branchcode) REFERENCES `branches` (branchcode) ON DELETE CASCADE ON UPDATE CASCADE |
18 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
18 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
19 |
|
19 |
|
20 |
-- |
20 |
-- |
Lines 28-34
CREATE TABLE IF NOT EXISTS clubs (
Link Here
|
28 |
description text, |
28 |
description text, |
29 |
date_start date DEFAULT NULL, |
29 |
date_start date DEFAULT NULL, |
30 |
date_end date DEFAULT NULL, |
30 |
date_end date DEFAULT NULL, |
31 |
`branchcode` varchar(10) COLLATE utf8_unicode_ci NULL DEFAULT NULL, |
31 |
branchcode varchar(10) NULL DEFAULT NULL, |
32 |
date_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
32 |
date_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
33 |
date_updated timestamp NULL DEFAULT NULL, |
33 |
date_updated timestamp NULL DEFAULT NULL, |
34 |
PRIMARY KEY (id), |
34 |
PRIMARY KEY (id), |
Lines 50-56
CREATE TABLE IF NOT EXISTS club_enrollments (
Link Here
|
50 |
date_canceled timestamp NULL DEFAULT NULL, |
50 |
date_canceled timestamp NULL DEFAULT NULL, |
51 |
date_created timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', |
51 |
date_created timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', |
52 |
date_updated timestamp NULL DEFAULT NULL, |
52 |
date_updated timestamp NULL DEFAULT NULL, |
53 |
`branchcode` varchar(10) COLLATE utf8_unicode_ci NULL DEFAULT NULL, |
53 |
branchcode varchar(10) NULL DEFAULT NULL, |
54 |
PRIMARY KEY (id), |
54 |
PRIMARY KEY (id), |
55 |
KEY club_id (club_id), |
55 |
KEY club_id (club_id), |
56 |
KEY borrowernumber (borrowernumber), |
56 |
KEY borrowernumber (borrowernumber), |
Lines 122-130
CREATE TABLE IF NOT EXISTS club_fields (
Link Here
|
122 |
CONSTRAINT club_fields_ibfk_4 FOREIGN KEY (club_id) REFERENCES clubs (id) ON DELETE CASCADE ON UPDATE CASCADE |
122 |
CONSTRAINT club_fields_ibfk_4 FOREIGN KEY (club_id) REFERENCES clubs (id) ON DELETE CASCADE ON UPDATE CASCADE |
123 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
123 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
124 |
|
124 |
|
125 |
INSERT INTO userflags (bit, flag, flagdesc, defaulton) VALUES (21, 'clubs', 'Patron clubs', '0'); |
125 |
INSERT IGNORE INTO userflags (bit, flag, flagdesc, defaulton) VALUES (21, 'clubs', 'Patron clubs', '0'); |
126 |
|
126 |
|
127 |
INSERT INTO permissions (module_bit, code, description) VALUES |
127 |
INSERT IGNORE INTO permissions (module_bit, code, description) VALUES |
128 |
(21, 'edit_templates', 'Create and update club templates'), |
128 |
(21, 'edit_templates', 'Create and update club templates'), |
129 |
(21, 'edit_clubs', 'Create and update clubs'), |
129 |
(21, 'edit_clubs', 'Create and update clubs'), |
130 |
(21, 'enroll', 'Enroll patrons in clubs') |
130 |
(21, 'enroll', 'Enroll patrons in clubs') |
131 |
- |
|
|