| Lines 2737-2753
          CREATE TABLE `accountlines` (
      
      
        Link Here | 
        
          | 2737 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | 2737 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | 
        
          | 2738 |  | 2738 |  | 
        
          | 2739 | -- | 2739 | -- | 
          
            
              | 2740 | -- Table structure for table `accountoffsets` | 2740 | -- Table structure for table `account_offsets` | 
        
          | 2741 | -- | 2741 | -- | 
        
          | 2742 |  | 2742 |  | 
          
            
              | 2743 | DROP TABLE IF EXISTS `accountoffsets`; | 2743 | DROP TABLE IF EXISTS `account_offsets`; | 
            
              | 2744 | CREATE TABLE `accountoffsets` ( | 2744 | CREATE TABLE `account_offsets` ( | 
            
              | 2745 |   `borrowernumber` int(11) NOT NULL default 0, | 2745 |   `id` int(11) NOT NULL auto_increment, -- unique identifier for each offset | 
            
              | 2746 |   `accountno` smallint(6) NOT NULL default 0, | 2746 |   `credit_id` int(11) NULL DEFAULT NULL, -- The id of the accountline the increased the patron's balance | 
            
              | 2747 |   `offsetaccount` smallint(6) NOT NULL default 0, | 2747 |   `debit_id` int(11) NULL DEFAULT NULL, -- The id of the accountline that decreased the patron's balance | 
            
              | 2748 |   `offsetamount` decimal(28,6) default NULL, | 2748 |   `type` varchar(16) NOT NULL, -- The type of offset this is | 
            
              | 2749 |   `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, | 2749 |   `amount` decimal(26,6) NOT NULL, -- The amount of the change | 
            
              | 2750 |   CONSTRAINT `accountoffsets_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE | 2750 |   `created_on` timestamp NOT NULL default CURRENT_TIMESTAMP, | 
            
              |  |  | 2751 |   PRIMARY KEY (`id`), | 
            
              | 2752 |   CONSTRAINT `account_offsets_ibfk_p` FOREIGN KEY (`credit_id`) REFERENCES `accountlines` (`accountlines_id`) ON DELETE CASCADE ON UPDATE CASCADE, | 
            
              | 2753 |   CONSTRAINT `account_offsets_ibfk_f` FOREIGN KEY (`debit_id`) REFERENCES `accountlines` (`accountlines_id`) ON DELETE CASCADE ON UPDATE CASCADE | 
        
          | 2751 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | 2754 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | 
        
          | 2752 |  | 2755 |  | 
        
          | 2753 | -- | 2756 | -- | 
            
              | 2754 | -  |  |  |