|
Lines 265-270
CREATE TABLE `borrowers` ( -- this table includes information about your patrons
Link Here
|
| 265 |
`altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower |
265 |
`altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower |
| 266 |
`smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on) |
266 |
`smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on) |
| 267 |
`privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history |
267 |
`privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history |
|
|
268 |
`account_balance` decimal(28,6) NOT NULL, |
| 268 |
UNIQUE KEY `cardnumber` (`cardnumber`), |
269 |
UNIQUE KEY `cardnumber` (`cardnumber`), |
| 269 |
PRIMARY KEY `borrowernumber` (`borrowernumber`), |
270 |
PRIMARY KEY `borrowernumber` (`borrowernumber`), |
| 270 |
KEY `categorycode` (`categorycode`), |
271 |
KEY `categorycode` (`categorycode`), |
|
Lines 2710-2759
CREATE TABLE `messages` ( -- circulation messages left via the patron's check ou
Link Here
|
| 2710 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
2711 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 2711 |
|
2712 |
|
| 2712 |
-- |
2713 |
-- |
| 2713 |
-- Table structure for table `accountlines` |
|
|
| 2714 |
-- |
| 2715 |
|
| 2716 |
DROP TABLE IF EXISTS `accountlines`; |
| 2717 |
CREATE TABLE `accountlines` ( |
| 2718 |
`accountlines_id` int(11) NOT NULL AUTO_INCREMENT, |
| 2719 |
`borrowernumber` int(11) NOT NULL default 0, |
| 2720 |
`accountno` smallint(6) NOT NULL default 0, |
| 2721 |
`itemnumber` int(11) default NULL, |
| 2722 |
`date` date default NULL, |
| 2723 |
`amount` decimal(28,6) default NULL, |
| 2724 |
`description` mediumtext, |
| 2725 |
`dispute` mediumtext, |
| 2726 |
`accounttype` varchar(5) default NULL, |
| 2727 |
`amountoutstanding` decimal(28,6) default NULL, |
| 2728 |
`lastincrement` decimal(28,6) default NULL, |
| 2729 |
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, |
| 2730 |
`notify_id` int(11) NOT NULL default 0, |
| 2731 |
`notify_level` int(2) NOT NULL default 0, |
| 2732 |
`note` text NULL default NULL, |
| 2733 |
`manager_id` int(11) NULL, |
| 2734 |
PRIMARY KEY (`accountlines_id`), |
| 2735 |
KEY `acctsborridx` (`borrowernumber`), |
| 2736 |
KEY `timeidx` (`timestamp`), |
| 2737 |
KEY `itemnumber` (`itemnumber`), |
| 2738 |
CONSTRAINT `accountlines_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE, |
| 2739 |
CONSTRAINT `accountlines_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE SET NULL |
| 2740 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 2741 |
|
| 2742 |
-- |
| 2743 |
-- Table structure for table `accountoffsets` |
| 2744 |
-- |
| 2745 |
|
| 2746 |
DROP TABLE IF EXISTS `accountoffsets`; |
| 2747 |
CREATE TABLE `accountoffsets` ( |
| 2748 |
`borrowernumber` int(11) NOT NULL default 0, |
| 2749 |
`accountno` smallint(6) NOT NULL default 0, |
| 2750 |
`offsetaccount` smallint(6) NOT NULL default 0, |
| 2751 |
`offsetamount` decimal(28,6) default NULL, |
| 2752 |
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, |
| 2753 |
CONSTRAINT `accountoffsets_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE |
| 2754 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 2755 |
|
| 2756 |
-- |
| 2757 |
-- Table structure for table `action_logs` |
2714 |
-- Table structure for table `action_logs` |
| 2758 |
-- |
2715 |
-- |
| 2759 |
|
2716 |
|
|
Lines 3478-3483
CREATE TABLE items_search_fields (
Link Here
|
| 3478 |
ON DELETE SET NULL ON UPDATE CASCADE |
3435 |
ON DELETE SET NULL ON UPDATE CASCADE |
| 3479 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
3436 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 3480 |
|
3437 |
|
|
|
3438 |
-- |
| 3439 |
-- Table structure for table 'account_credits' |
| 3440 |
-- |
| 3441 |
DROP TABLE IF EXISTS account_credits; |
| 3442 |
CREATE TABLE IF account_credits ( |
| 3443 |
credit_id int(11) NOT NULL AUTO_INCREMENT, -- The unique id for this credit |
| 3444 |
borrowernumber int(11) NOT NULL, -- The borrower this credit applies to |
| 3445 |
`type` varchar(255) NOT NULL, -- The type of credit this is ( defined by Koha::Accounts::CreditTypes ) |
| 3446 |
amount_received decimal(28,6) DEFAULT NULL, -- If this was a cash payment, the amount of money given |
| 3447 |
amount_paid decimal(28,6) NOT NULL, -- The actual ammount paid, if less than amount_recieved, change was given back |
| 3448 |
amount_remaining decimal(28,6) NOT NULL, -- The amount of this credit that has not been applied to outstanding debits |
| 3449 |
amount_voided decimal(28,6) NULL DEFAULT NULL, -- The amount of this credit was for before it was voided |
| 3450 |
notes text, -- Misc notes for this credit |
| 3451 |
branchcode VARCHAR( 10 ) NULL DEFAULT NULL, -- Branchcode where the credit was created ( if any ) |
| 3452 |
manager_id int(11) DEFAULT NULL, -- The borrowernumber of the user who created this credit ( if any ) |
| 3453 |
created_on timestamp NULL DEFAULT NULL, -- Timestamp for when this credit was created |
| 3454 |
updated_on timestamp NULL DEFAULT NULL, -- Timestamp for when this credit was last modified |
| 3455 |
PRIMARY KEY (credit_id), |
| 3456 |
KEY borrowernumber (borrowernumber), |
| 3457 |
KEY branchcode (branchcode) |
| 3458 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 3459 |
|
| 3460 |
-- |
| 3461 |
-- Constraints for table `account_credits` |
| 3462 |
-- |
| 3463 |
ALTER TABLE `account_credits` |
| 3464 |
ADD CONSTRAINT account_credits_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE, |
| 3465 |
ADD CONSTRAINT account_credits_ibfk_2 FOREIGN KEY (branchcode) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE; |
| 3466 |
|
| 3467 |
-- |
| 3468 |
-- Table structure for table 'account_debits' |
| 3469 |
-- |
| 3470 |
|
| 3471 |
DROP TABLE IF EXISTS account_debits; |
| 3472 |
CREATE TABLE account_debits ( |
| 3473 |
debit_id int(11) NOT NULL AUTO_INCREMENT, -- The unique id for this debit |
| 3474 |
borrowernumber int(11) NOT NULL DEFAULT '0', -- The borrower this debit applies to |
| 3475 |
itemnumber int(11) DEFAULT NULL, -- The item related to this debit ( for fines, lost fees, etc ) |
| 3476 |
issue_id int(11) DEFAULT NULL, -- The checkout this debit is related to ( again, for fines, lost fees, etc ) |
| 3477 |
`type` varchar(255) NOT NULL, -- The type of debit this is ( defined by Koha::Accounts::DebitTypes ) |
| 3478 |
accruing tinyint(1) NOT NULL DEFAULT '0', -- Boolean flag, tells of if this is a fine that is still accruing |
| 3479 |
amount_original decimal(28,6) DEFAULT NULL, -- The total amount of this debit |
| 3480 |
amount_outstanding decimal(28,6) DEFAULT NULL, -- The amount still owed on this debit |
| 3481 |
amount_last_increment decimal(28,6) DEFAULT NULL, -- The amount by which this debit last changed |
| 3482 |
description mediumtext, -- The description for this debit |
| 3483 |
notes text, -- Misc notes for this debit |
| 3484 |
branchcode VARCHAR( 10 ) NULL DEFAULT NULL, -- Branchcode where the debit was created ( if any ) |
| 3485 |
manager_id int(11) DEFAULT NULL, -- The borrowernumber of the user who created this debit ( if any ) |
| 3486 |
created_on timestamp NULL DEFAULT NULL, -- Timestamp for when this credit was created |
| 3487 |
updated_on timestamp NULL DEFAULT NULL, -- Timestamp for when this credit was last modified |
| 3488 |
PRIMARY KEY (debit_id), |
| 3489 |
KEY acctsborridx (borrowernumber), |
| 3490 |
KEY itemnumber (itemnumber), |
| 3491 |
KEY borrowernumber (borrowernumber), |
| 3492 |
KEY issue_id (issue_id), |
| 3493 |
KEY branchcode (branchcode) |
| 3494 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 3495 |
|
| 3496 |
-- |
| 3497 |
-- Constraints for table `account_debits` |
| 3498 |
-- |
| 3499 |
ALTER TABLE `account_debits` |
| 3500 |
ADD CONSTRAINT account_debits_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE, |
| 3501 |
ADD CONSTRAINT account_debits_ibfk_2 FOREIGN KEY (branchcode) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE; |
| 3502 |
|
| 3503 |
-- |
| 3504 |
-- Table structure for table 'account_offsets' |
| 3505 |
-- |
| 3506 |
|
| 3507 |
DROP TABLE IF EXISTS account_offsets; |
| 3508 |
CREATE TABLE account_offsets ( |
| 3509 |
offset_id int(11) NOT NULL AUTO_INCREMENT, -- Unique id for this offset |
| 3510 |
debit_id int(11) DEFAULT NULL, -- Related debit |
| 3511 |
credit_id int(11) DEFAULT NULL, -- Related credit ( if any ) |
| 3512 |
`type` varchar(255) DEFAULT NULL, -- The type of this offset ( defined by Koha::Accounts::OffsetTypes ), if any |
| 3513 |
amount decimal(28,6) NOT NULL, -- The amount of the offset, positive means patron owes more, negative means patron owes less |
| 3514 |
created_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- Timestamp for when this offset was created |
| 3515 |
PRIMARY KEY (offset_id), |
| 3516 |
KEY fee_id (debit_id), |
| 3517 |
KEY payment_id (credit_id) |
| 3518 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 3519 |
|
| 3520 |
-- |
| 3521 |
-- Constraints for table `account_offsets` |
| 3522 |
-- |
| 3523 |
ALTER TABLE `account_offsets` |
| 3524 |
ADD CONSTRAINT account_offsets_ibfk_1 FOREIGN KEY (debit_id) REFERENCES account_debits (debit_id) ON DELETE CASCADE ON UPDATE CASCADE, |
| 3525 |
ADD CONSTRAINT account_offsets_ibfk_2 FOREIGN KEY (credit_id) REFERENCES account_credits (credit_id) ON DELETE CASCADE ON UPDATE CASCADE; |
| 3526 |
|
| 3481 |
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; |
3527 |
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; |
| 3482 |
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; |
3528 |
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; |
| 3483 |
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; |
3529 |
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; |