CREATE TABLE `user` ( `username` varchar(255) PRIMARY KEY ); CREATE TABLE `oauth_connection` ( `username` varchar(255), `rank` int, `provider_id` int, `provider_user_id` varchar(255), `display_name` varchar(255), `access_token` varchar(255), `expires_at` datetime, FOREIGN KEY(`username`) REFERENCES `user` (`username`), FOREIGN KEY(`provider_id`) REFERENCES `oauth_provider` (`id`) ); CREATE TABLE `oauth_provider` ( `id` int PRIMARY KEY, `name` varchar(255) );