I’m creating a new site for tools (see next post) built on the top of Keruald/Pluton. This is the opportunity to refresh the SQL schema. It supports 16 777 215 users account, is IPv6 and salted password compliant. Here the new minimal SQL schema for MySQL:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
CREATE TABLE `sessions` ( `session_id` varchar(32) NOT NULL DEFAULT '', `session_ip` varchar(45) NOT NULL DEFAULT '', -- Native IPv6 are 39 chars max and with IPv4 tunnel 45 chars `session_resource` mediumint(5) NOT NULL DEFAULT 1, `user_id` mediumint(5) NOT NULL DEFAULT '-1', `session_online` tinyint(4) NOT NULL DEFAULT '1', `session_updated` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`session_id`), KEY `Where` (`session_resource`), KEY `WhereWhen` (`session_resource`, `session_updated`) ) ENGINE=MEMORY COMMENT='Sessions for Keruald sites'; CREATE TABLE `users` ( `user_id` mediumint(5) NOT NULL DEFAULT '0', `username` varchar(11) NOT NULL DEFAULT '', `user_password_salt` varchar(32) NOT NULL DEFAULT '', `user_password` varchar(32) NOT NULL DEFAULT '', `user_active` tinyint(1) NOT NULL DEFAULT '0', `user_actkey` varchar(11) DEFAULT NULL, `user_email` varchar(63) NOT NULL DEFAULT '', `user_regdate` int(10) NOT NULL DEFAULT '0', PRIMARY KEY (`user_id`), KEY user_active (`user_active`) ) COMMENT='Users for Keruald sites'; |