Lines 1597-1602
CREATE TABLE `borrowers` ( -- this table includes information about your patrons
Link Here
|
1597 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
1597 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
1598 |
|
1598 |
|
1599 |
-- |
1599 |
-- |
|
|
1600 |
-- Table structure for table `anonymized_borrowers` |
1601 |
-- |
1602 |
|
1603 |
DROP TABLE IF EXISTS `anonymized_borrowers`; |
1604 |
CREATE TABLE `anonymized_borrowers` ( |
1605 |
`hashed_borrowernumber` VARCHAR(60) NOT NULL, |
1606 |
`has_cardnumber` TINYINT(1) NOT NULL DEFAULT 0, -- if the patron has a cardnumber (boolean field) |
1607 |
`title` LONGTEXT, -- patron/borrower's title, for example: Mr. or Mrs. |
1608 |
`city` LONGTEXT, -- the city or town for your patron/borrower's primary address |
1609 |
`state` MEDIUMTEXT default NULL, -- the state or province for your patron/borrower's primary address |
1610 |
`zipcode` varchar(25) default NULL, -- the zip or postal code for your patron/borrower's primary address |
1611 |
`country` MEDIUMTEXT, -- the country for your patron/borrower's primary address |
1612 |
`branchcode` varchar(10) NOT NULL default '', -- foreign key from the branches table, includes the code of the patron/borrower's home branch |
1613 |
`categorycode` varchar(10) NOT NULL default '', -- foreign key from the categories table, includes the code of the patron category |
1614 |
`dateenrolled` date default NULL, -- date the patron was added to Koha (YYYY-MM-DD) |
1615 |
`sex` varchar(1) default NULL, -- patron/borrower's gender |
1616 |
`sort1` varchar(80) default NULL, -- a field that can be used for any information unique to the library |
1617 |
`sort2` varchar(80) default NULL, -- a field that can be used for any information unique to the library |
1618 |
PRIMARY KEY `hashed_borrowernumber` (`hashed_borrowernumber`), |
1619 |
CONSTRAINT `anon_borrowers_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`), |
1620 |
CONSTRAINT `anon_borrowers_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) |
1621 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
1622 |
|
1623 |
-- |
1624 |
-- Table structure for table `anonymized_transactions` |
1625 |
-- |
1626 |
|
1627 |
DROP TABLE IF EXISTS `anonymized_transactions`; |
1628 |
CREATE TABLE `anonymized_transactions` ( |
1629 |
`hashed_borrowernumber` VARCHAR(60) NOT NULL, |
1630 |
`datetime` datetime default NULL, -- date and time of the transaction |
1631 |
`branchcode` varchar(10) default NULL, -- foreign key, branch where the transaction occurred |
1632 |
`transaction_type` varchar(16) default NULL, -- transaction type (localuse, issue, return, renew, writeoff, payment) |
1633 |
`itemnumber` int(11) default NULL, -- foreign key from the items table, links transaction to a specific item |
1634 |
`itemtype` varchar(10) default NULL, -- foreign key from the itemtypes table, links transaction to a specific item type |
1635 |
`holdingbranch` varchar(10) default null, |
1636 |
`location` varchar(80) default NULL, -- authorized value for the shelving location for this item (MARC21 952$c) |
1637 |
`itemcallnumber` varchar(255) default NULL, -- item's itemcallnumber |
1638 |
`ccode` varchar(80) default NULL, -- foreign key from the items table, links transaction to a specific collection code |
1639 |
CONSTRAINT `anonymized_transactions_ibfk_1` FOREIGN KEY (`hashed_borrowernumber`) REFERENCES `anonymized_borrowers` (`hashed_borrowernumber`) |
1640 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
1641 |
|
1642 |
-- |
1600 |
-- Table structure for table `borrower_attributes` |
1643 |
-- Table structure for table `borrower_attributes` |
1601 |
-- |
1644 |
-- |
1602 |
|
1645 |
|
1603 |
- |
|
|