add table tblApiKeys

This commit is contained in:
Uwe Steinmann 2020-06-16 08:27:54 +02:00
parent 64aab1aa1d
commit 0bdf51be40
3 changed files with 43 additions and 0 deletions

View File

@ -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`
--

View File

@ -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`
--

View File

@ -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`
--