CONSTRAINT borrower_sync_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+--
+-- Table structure for table api_keys
+--
+
+DROP TABLE IF EXISTS `api_keys`;
+CREATE TABLE `api_keys` (
+ `client_id` VARCHAR(191) NOT NULL, -- API client ID
+ `secret` VARCHAR(191) NOT NULL, -- API client secret used for API authentication
+ `description` VARCHAR(255) NOT NULL, -- API client description
+ `patron_id` INT(11) NOT NULL, -- Foreign key to the borrowers table
+ `active` TINYINT(1) DEFAULT 1 NOT NULL, -- 0 means this API key is revoked
+ PRIMARY KEY `client_id` (`client_id`),
+ UNIQUE KEY `secret` (`secret`),
+ KEY `patron_id` (`patron_id`),
+ CONSTRAINT `api_keys_fk_patron_id`
+ FOREIGN KEY (`patron_id`)
+ REFERENCES `borrowers` (`borrowernumber`)
+ ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+
--
-- Table structure for table `issues`
--
`unitprice_tax_excluded` decimal(28,6) default NULL, -- the unit price excluding tax (on receiving)
`unitprice_tax_included` decimal(28,6) default NULL, -- the unit price including tax (on receiving)
`quantityreceived` smallint(6) NOT NULL default 0, -- the quantity that have been received so far
+ `created_by` int(11) NULL DEFAULT NULL, -- the borrowernumber of order line's creator
`datecancellationprinted` date default NULL, -- the date the line item was deleted
`cancellationreason` MEDIUMTEXT default NULL, -- reason of cancellation
`order_internalnote` LONGTEXT, -- notes related to this order line, made for staff