Bug 12395: Save order line's creator
[koha.git] / installer / data / mysql / kohastructure.sql
index ea59d03..c6f7f01 100644 (file)
@@ -1713,6 +1713,26 @@ CREATE TABLE borrower_sync (
   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`
 --
@@ -3139,6 +3159,7 @@ CREATE TABLE `aqorders` ( -- information related to the basket line items
   `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