From 9dd21bda6d76c89b72303239cc4e7440ff74a0bc Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 11 May 2021 06:19:23 +0000 Subject: [PATCH] OAuth login prototype --- database.sql | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/database.sql b/database.sql index 666a48f667..bbcd479bc9 100644 --- a/database.sql +++ b/database.sql @@ -1,6 +1,6 @@ -- ------------------------------------------ -- Friendica 2021.06-dev (Siberian Iris) --- DB_UPDATE_VERSION 1415 +-- DB_UPDATE_VERSION 1416 -- ------------------------------------------ @@ -379,6 +379,21 @@ CREATE TABLE IF NOT EXISTS `application` ( UNIQUE INDEX `client_id` (`client_id`) ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='OAuth application'; +-- +-- TABLE application-token +-- +CREATE TABLE IF NOT EXISTS `application-token` ( + `application-id` int unsigned NOT NULL COMMENT '', + `uid` mediumint unsigned NOT NULL COMMENT 'Owner User id', + `code` varchar(64) NOT NULL COMMENT '', + `access_token` varchar(64) NOT NULL COMMENT '', + `created_at` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'creation time', + PRIMARY KEY(`application-id`,`uid`), + INDEX `uid_id` (`uid`,`application-id`), + FOREIGN KEY (`application-id`) REFERENCES `application` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE, + FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE +) DEFAULT COLLATE utf8mb4_general_ci COMMENT='OAuth user token'; + -- -- TABLE attach --