From 0bdf51be4009b56e6bc5228b35510a980ab10f43 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 16 Jun 2020 08:27:54 +0200 Subject: [PATCH] add table tblApiKeys --- install/create_tables-innodb.sql | 15 +++++++++++++++ install/create_tables-postgres.sql | 14 ++++++++++++++ install/create_tables-sqlite3.sql | 14 ++++++++++++++ 3 files changed, 43 insertions(+) diff --git a/install/create_tables-innodb.sql b/install/create_tables-innodb.sql index 4357f12e9..a8ab87c6e 100644 --- a/install/create_tables-innodb.sql +++ b/install/create_tables-innodb.sql @@ -91,6 +91,21 @@ CREATE TABLE `tblUsers` ( -- -------------------------------------------------------- +-- +-- Table structure for table `tblApiKeys` +-- + +CREATE TABLE `tblApiKeys` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `user` int(11) DEFAULT NULL, + `apikey` varchar(32) NOT NULL, + `expires` datetime DEFAULT NULL, + `disabled` smallint(1) NOT NULL DEFAULT '0', + CONSTRAINT `tblApiKeys_user` FOREIGN KEY (`user`) REFERENCES `tblUsers` (`id`) ON DELETE CASCADE, +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + -- -- Table structure for table `tblUserSubstitutes` -- diff --git a/install/create_tables-postgres.sql b/install/create_tables-postgres.sql index afd6bc555..a116535d1 100644 --- a/install/create_tables-postgres.sql +++ b/install/create_tables-postgres.sql @@ -84,6 +84,20 @@ CREATE TABLE "tblUsers" ( -- -------------------------------------------------------- +-- +-- Table structure for table `tblApiKeys` +-- + +CREATE TABLE "tblApiKeys" ( + "id" SERIAL UNIQUE, + "user" INTEGER DEFAULT NULL REFERENCES "tblUsers" ("id") ON DELETE CASCADE, + "apikey" varchar(32) NOT NULL, + "expires" TIMESTAMP DEFAULT NULL + "disabled" INTEGER NOT NULL default '0' +); + +-- -------------------------------------------------------- + -- -- Table structure for table `tblUserSubstitutes` -- diff --git a/install/create_tables-sqlite3.sql b/install/create_tables-sqlite3.sql index 1e7a1662e..e15ba28b8 100644 --- a/install/create_tables-sqlite3.sql +++ b/install/create_tables-sqlite3.sql @@ -85,6 +85,20 @@ CREATE TABLE `tblUsers` ( -- -------------------------------------------------------- +-- +-- Table structure for table `tblApiKeys` +-- + +CREATE TABLE `tblApiKeys` ( + `id` INTEGER PRIMARY KEY AUTOINCREMENT, + `user` INTEGER DEFAULT NULL REFERENCES `tblUsers` (`id`) ON DELETE CASCADE, + `apikey` varchar(32) NOT NULL, + `expires` TEXT NOT NULL + `disabled` INTEGER NOT NULL DEFAULT '0' +); + +-- -------------------------------------------------------- + -- -- Table structure for table `tblUserSubstitutes` --