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 2678-2727
CREATE TABLE `messages` ( -- circulation messages left via the patron's check ou
Link Here
|
2678 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
2679 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
2679 |
|
2680 |
|
2680 |
-- |
2681 |
-- |
2681 |
-- Table structure for table `accountlines` |
|
|
2682 |
-- |
2683 |
|
2684 |
DROP TABLE IF EXISTS `accountlines`; |
2685 |
CREATE TABLE `accountlines` ( |
2686 |
`accountlines_id` int(11) NOT NULL AUTO_INCREMENT, |
2687 |
`borrowernumber` int(11) NOT NULL default 0, |
2688 |
`accountno` smallint(6) NOT NULL default 0, |
2689 |
`itemnumber` int(11) default NULL, |
2690 |
`date` date default NULL, |
2691 |
`amount` decimal(28,6) default NULL, |
2692 |
`description` mediumtext, |
2693 |
`dispute` mediumtext, |
2694 |
`accounttype` varchar(5) default NULL, |
2695 |
`amountoutstanding` decimal(28,6) default NULL, |
2696 |
`lastincrement` decimal(28,6) default NULL, |
2697 |
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, |
2698 |
`notify_id` int(11) NOT NULL default 0, |
2699 |
`notify_level` int(2) NOT NULL default 0, |
2700 |
`note` text NULL default NULL, |
2701 |
`manager_id` int(11) NULL, |
2702 |
PRIMARY KEY (`accountlines_id`), |
2703 |
KEY `acctsborridx` (`borrowernumber`), |
2704 |
KEY `timeidx` (`timestamp`), |
2705 |
KEY `itemnumber` (`itemnumber`), |
2706 |
CONSTRAINT `accountlines_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE, |
2707 |
CONSTRAINT `accountlines_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE SET NULL |
2708 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
2709 |
|
2710 |
-- |
2711 |
-- Table structure for table `accountoffsets` |
2712 |
-- |
2713 |
|
2714 |
DROP TABLE IF EXISTS `accountoffsets`; |
2715 |
CREATE TABLE `accountoffsets` ( |
2716 |
`borrowernumber` int(11) NOT NULL default 0, |
2717 |
`accountno` smallint(6) NOT NULL default 0, |
2718 |
`offsetaccount` smallint(6) NOT NULL default 0, |
2719 |
`offsetamount` decimal(28,6) default NULL, |
2720 |
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, |
2721 |
CONSTRAINT `accountoffsets_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE |
2722 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
2723 |
|
2724 |
-- |
2725 |
-- Table structure for table `action_logs` |
2682 |
-- Table structure for table `action_logs` |
2726 |
-- |
2683 |
-- |
2727 |
|
2684 |
|
Lines 3387-3392
CREATE TABLE IF NOT EXISTS marc_modification_template_actions (
Link Here
|
3387 |
CONSTRAINT `mmta_ibfk_1` FOREIGN KEY (`template_id`) REFERENCES `marc_modification_templates` (`template_id`) ON DELETE CASCADE ON UPDATE CASCADE |
3344 |
CONSTRAINT `mmta_ibfk_1` FOREIGN KEY (`template_id`) REFERENCES `marc_modification_templates` (`template_id`) ON DELETE CASCADE ON UPDATE CASCADE |
3388 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
3345 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
3389 |
|
3346 |
|
|
|
3347 |
-- |
3348 |
-- Table structure for table 'account_credits' |
3349 |
-- |
3350 |
DROP TABLE IF EXISTS account_credits; |
3351 |
CREATE TABLE IF account_credits ( |
3352 |
credit_id int(11) NOT NULL AUTO_INCREMENT, -- The unique id for this credit |
3353 |
borrowernumber int(11) NOT NULL, -- The borrower this credit applies to |
3354 |
`type` varchar(255) NOT NULL, -- The type of credit this is ( defined by Koha::Accounts::CreditTypes ) |
3355 |
amount_received decimal(28,6) DEFAULT NULL, -- If this was a cash payment, the amount of money given |
3356 |
amount_paid decimal(28,6) NOT NULL, -- The actual ammount paid, if less than amount_recieved, change was given back |
3357 |
amount_remaining decimal(28,6) NOT NULL, -- The amount of this credit that has not been applied to outstanding debits |
3358 |
notes text, -- Misc notes for this credit |
3359 |
manager_id int(11) DEFAULT NULL, -- The borrowernumber of the user who created this credit ( if any ) |
3360 |
created_on timestamp NULL DEFAULT NULL, -- Timestamp for when this credit was created |
3361 |
updated_on timestamp NULL DEFAULT NULL, -- Timestamp for when this credit was last modified |
3362 |
PRIMARY KEY (credit_id), |
3363 |
KEY borrowernumber (borrowernumber) |
3364 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
3365 |
|
3366 |
-- |
3367 |
-- Constraints for table `account_credits` |
3368 |
-- |
3369 |
ALTER TABLE `account_credits` |
3370 |
ADD CONSTRAINT account_credits_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE; |
3371 |
|
3372 |
-- |
3373 |
-- Table structure for table 'account_debits' |
3374 |
-- |
3375 |
|
3376 |
DROP TABLE IF EXISTS account_debits; |
3377 |
CREATE TABLE account_debits ( |
3378 |
debit_id int(11) NOT NULL AUTO_INCREMENT, -- The unique id for this debit |
3379 |
borrowernumber int(11) NOT NULL DEFAULT '0', -- The borrower this debit applies to |
3380 |
itemnumber int(11) DEFAULT NULL, -- The item related to this debit ( for fines, lost fees, etc ) |
3381 |
issue_id int(11) DEFAULT NULL, -- The checkout this debit is related to ( again, for fines, lost fees, etc ) |
3382 |
`type` varchar(255) NOT NULL, -- The type of debit this is ( defined by Koha::Accounts::DebitTypes ) |
3383 |
accruing tinyint(1) NOT NULL DEFAULT '0', -- Boolean flag, tells of if this is a fine that is still accruing |
3384 |
amount_original decimal(28,6) DEFAULT NULL, -- The total amount of this debit |
3385 |
amount_outstanding decimal(28,6) DEFAULT NULL, -- The amount still owed on this debit |
3386 |
amount_last_increment decimal(28,6) DEFAULT NULL, -- The amount by which this debit last changed |
3387 |
description mediumtext, -- The description for this debit |
3388 |
notes text, -- Misc notes for this debit |
3389 |
manager_id int(11) DEFAULT NULL, -- The borrowernumber of the user who created this debit ( if any ) |
3390 |
created_on timestamp NULL DEFAULT NULL, -- Timestamp for when this credit was created |
3391 |
updated_on timestamp NULL DEFAULT NULL, -- Timestamp for when this credit was last modified |
3392 |
PRIMARY KEY (debit_id), |
3393 |
KEY acctsborridx (borrowernumber), |
3394 |
KEY itemnumber (itemnumber), |
3395 |
KEY borrowernumber (borrowernumber), |
3396 |
KEY issue_id (issue_id) |
3397 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
3398 |
|
3399 |
-- |
3400 |
-- Constraints for table `account_debits` |
3401 |
-- |
3402 |
ALTER TABLE `account_debits` |
3403 |
ADD CONSTRAINT account_debits_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE; |
3404 |
|
3405 |
-- |
3406 |
-- Table structure for table 'account_offsets' |
3407 |
-- |
3408 |
|
3409 |
DROP TABLE IF EXISTS account_offsets; |
3410 |
CREATE TABLE account_offsets ( |
3411 |
offset_id int(11) NOT NULL AUTO_INCREMENT, -- Unique id for this offset |
3412 |
debit_id int(11) DEFAULT NULL, -- Related debit |
3413 |
credit_id int(11) DEFAULT NULL, -- Related credit ( if any ) |
3414 |
`type` varchar(255) DEFAULT NULL, -- The type of this offset ( defined by Koha::Accounts::OffsetTypes ), if any |
3415 |
amount decimal(28,6) NOT NULL, -- The amount of the offset, positive means patron owes more, negative means patron owes less |
3416 |
created_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- Timestamp for when this offset was created |
3417 |
PRIMARY KEY (offset_id), |
3418 |
KEY fee_id (debit_id), |
3419 |
KEY payment_id (credit_id) |
3420 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
3421 |
|
3422 |
-- |
3423 |
-- Constraints for table `account_offsets` |
3424 |
-- |
3425 |
ALTER TABLE `account_offsets` |
3426 |
ADD CONSTRAINT account_offsets_ibfk_1 FOREIGN KEY (debit_id) REFERENCES account_debits (debit_id) ON DELETE CASCADE ON UPDATE CASCADE, |
3427 |
ADD CONSTRAINT account_offsets_ibfk_2 FOREIGN KEY (credit_id) REFERENCES account_credits (credit_id) ON DELETE CASCADE ON UPDATE CASCADE; |
3428 |
|
3429 |
|
3390 |
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; |
3430 |
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; |
3391 |
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; |
3431 |
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; |
3392 |
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; |
3432 |
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; |