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