Lines 1808-1841
CREATE TABLE `club_fields` (
Link Here
|
1808 |
/*!40101 SET character_set_client = @saved_cs_client */; |
1808 |
/*!40101 SET character_set_client = @saved_cs_client */; |
1809 |
|
1809 |
|
1810 |
-- |
1810 |
-- |
1811 |
-- Table structure for table `volumes` |
1811 |
-- Table structure for table `item_groups` |
1812 |
-- |
1812 |
-- |
1813 |
|
1813 |
|
1814 |
DROP TABLE IF EXISTS `volumes`; |
1814 |
DROP TABLE IF EXISTS `item_groups`; |
1815 |
CREATE TABLE `volumes` ( -- information related to bibliographic records in Koha |
1815 |
CREATE TABLE `item_groups` ( |
1816 |
`id` int(11) NOT NULL auto_increment, -- primary key, unique identifier assigned by Koha |
1816 |
`item_group_id` INT(11) NOT NULL auto_increment COMMENT "id for the items group", |
1817 |
`biblionumber` INT(11) NOT NULL default 0, -- foreign key linking this table to the biblio table |
1817 |
`biblio_id` INT(11) NOT NULL DEFAULT 0 COMMENT "id for the bibliographic record the group belongs to", |
1818 |
`display_order` INT(4) NOT NULL default 0, -- specifies the 'sort order' for volumes |
1818 |
`display_order` INT(4) NOT NULL DEFAULT 0 COMMENT "The 'sort order' for item_groups", |
1819 |
`description` MEDIUMTEXT default NULL, -- equivilent to enumchron |
1819 |
`description` MEDIUMTEXT default NULL COMMENT "A group description", |
1820 |
`created_on` TIMESTAMP NULL, -- Time and date the volume was created |
1820 |
`created_on` TIMESTAMP NULL COMMENT "Time and date the group was created", |
1821 |
`updated_on` TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- Time and date of the latest change on the volume (description) |
1821 |
`updated_on` TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT "Time and date of the latest change on the group", |
1822 |
PRIMARY KEY (`id`), |
1822 |
PRIMARY KEY (`item_group_id`), |
1823 |
CONSTRAINT `volumes_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE |
1823 |
CONSTRAINT `item_groups_ibfk_1` FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE |
1824 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
1824 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
1825 |
|
1825 |
|
1826 |
-- |
1826 |
-- |
1827 |
-- Table structure for table `volume_items` |
1827 |
-- Table structure for table `item_group_items` |
1828 |
-- |
1828 |
-- |
1829 |
|
1829 |
|
1830 |
DROP TABLE IF EXISTS `volume_items`; |
1830 |
DROP TABLE IF EXISTS `item_group_items`; |
1831 |
CREATE TABLE `volume_items` ( -- information related to bibliographic records in Koha |
1831 |
CREATE TABLE `item_group_items` ( |
1832 |
`id` int(11) NOT NULL auto_increment, -- primary key, unique identifier assigned by Koha |
1832 |
`item_group_items_id` int(11) NOT NULL auto_increment COMMENT "id for the group/item link", |
1833 |
`volume_id` int(11) NOT NULL default 0, -- foreign key making this table a 1 to 1 join from items to volumes |
1833 |
`item_group_id` INT(11) NOT NULL DEFAULT 0 COMMENT "foreign key making this table a 1 to 1 join from items to item groups", |
1834 |
`itemnumber` int(11) NOT NULL default 0, -- foreign key linking this table to the items table |
1834 |
`item_id` INT(11) NOT NULL DEFAULT 0 COMMENT "foreign key linking this table to the items table", |
1835 |
PRIMARY KEY (`id`), |
1835 |
PRIMARY KEY (`item_group_items_id`), |
1836 |
UNIQUE KEY (volume_id,itemnumber), |
1836 |
UNIQUE KEY (item_group_id,item_id), |
1837 |
CONSTRAINT `volume_items_iifk_1` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE, |
1837 |
CONSTRAINT `item_group_items_iifk_1` FOREIGN KEY (`item_id`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE, |
1838 |
CONSTRAINT `volume_items_vifk_1` FOREIGN KEY (`volume_id`) REFERENCES `volumes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE |
1838 |
CONSTRAINT `item_group_items_vifk_1` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE CASCADE ON UPDATE CASCADE |
1839 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
1839 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
1840 |
|
1840 |
|
1841 |
-- |
1841 |
-- |