CREATE TABLE `User` ( `id` int PRIMARY KEY, `email` varchar(255), `password` varchar(255) ); CREATE TABLE `AuthInfo` ( `id` int PRIMARY KEY, `user_id` int, `client_id` int, `scope` varchar(255), `refresh_token` varchar(255), `code` varchar(255), `redirect_uri` varchar(255), FOREIGN KEY(`user_id`) REFERENCES `User` (`id`), FOREIGN KEY(`client_id`) REFERENCES `Client` (`id`), FOREIGN KEY(`scope`) REFERENCES `Scope` (`id`), FOREIGN KEY(`redirect_uri`) REFERENCES `Client` (`redirect_uri`) ); CREATE TABLE `Client` ( `id` int PRIMARY KEY, `redirect_uri` varchar(255), `secret` varchar(255), `name` varchar(255) ); CREATE TABLE `Scope` ( `id` varchar(255) PRIMARY KEY, `description` varchar(255) );