{"id":189,"date":"2013-01-19T04:31:04","date_gmt":"2013-01-19T03:31:04","guid":{"rendered":"http:\/\/www.dereckson.be\/blog\/?p=189"},"modified":"2013-01-19T04:31:04","modified_gmt":"2013-01-19T03:31:04","slug":"minimal-sql-schema-for-keruald-and-pluton","status":"publish","type":"post","link":"https:\/\/www.dereckson.be\/blog\/2013\/01\/19\/minimal-sql-schema-for-keruald-and-pluton\/","title":{"rendered":"Minimal SQL schema for Keruald and Pluton"},"content":{"rendered":"<p>I&#8217;m creating a new site for tools (see next post) built on the top of <a href=\"http:\/\/keruald.sf.net\">Keruald\/Pluton<\/a>.<\/p>\n<p>This is the opportunity to refresh the SQL schema.<\/p>\n<p>It supports <code>16 777 215 <\/code>users account, is <a title=\" Maximum length of the textual representation of an IPv6 address?  on Stack Overflow\" href=\"http:\/\/stackoverflow.com\/questions\/166132\/maximum-length-of-the-textual-representation-of-an-ipv6-address\">IPv6<\/a> and <a title=\"Salted Password Hashing - Doing it Right\" href=\"http:\/\/crackstation.net\/hashing-security.htm\">salted password<\/a> compliant.<\/p>\n<p>Here the new minimal SQL schema for MySQL:<\/p>\n<pre>CREATE TABLE `sessions` (\r\n`session_id` varchar(32) NOT NULL DEFAULT '',\r\n`session_ip` varchar(45) NOT NULL DEFAULT '', -- Native IPv6 are 39 chars max and with IPv4 tunnel 45 chars\r\n`session_resource` mediumint(5) NOT NULL DEFAULT 1,\r\n`user_id` mediumint(5) NOT NULL DEFAULT '-1',\r\n`session_online` tinyint(4) NOT NULL DEFAULT '1',\r\n`session_updated` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\r\nPRIMARY KEY (`session_id`),\r\nKEY `Where` (`session_resource`),\r\nKEY `WhereWhen` (`session_resource`, `session_updated`)\r\n) ENGINE=MEMORY COMMENT='Sessions for Keruald sites';\r\n\r\nCREATE TABLE `users` (\r\n`user_id` mediumint(5) NOT NULL DEFAULT '0',\r\n`username` varchar(11) NOT NULL DEFAULT '',\r\n`user_password_salt` varchar(32) NOT NULL DEFAULT '',\r\n`user_password` varchar(32) NOT NULL DEFAULT '',\r\n`user_active` tinyint(1) NOT NULL DEFAULT '0',\r\n`user_actkey` varchar(11) DEFAULT NULL,\r\n`user_email` varchar(63) NOT NULL DEFAULT '',\r\n`user_regdate` int(10) NOT NULL DEFAULT '0',\r\nPRIMARY KEY (`user_id`),\r\nKEY user_active (`user_active`)\r\n) COMMENT='Users for Keruald sites';<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;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: CREATE TABLE `sessions` ( `session_id` varchar(32) NOT NULL DEFAULT [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[49],"tags":[78,79,80],"class_list":["post-189","post","type-post","status-publish","format-standard","hentry","category-dev","tag-keruald","tag-pluton","tag-sql"],"_links":{"self":[{"href":"https:\/\/www.dereckson.be\/blog\/wp-json\/wp\/v2\/posts\/189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dereckson.be\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dereckson.be\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dereckson.be\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dereckson.be\/blog\/wp-json\/wp\/v2\/comments?post=189"}],"version-history":[{"count":2,"href":"https:\/\/www.dereckson.be\/blog\/wp-json\/wp\/v2\/posts\/189\/revisions"}],"predecessor-version":[{"id":191,"href":"https:\/\/www.dereckson.be\/blog\/wp-json\/wp\/v2\/posts\/189\/revisions\/191"}],"wp:attachment":[{"href":"https:\/\/www.dereckson.be\/blog\/wp-json\/wp\/v2\/media?parent=189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dereckson.be\/blog\/wp-json\/wp\/v2\/categories?post=189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dereckson.be\/blog\/wp-json\/wp\/v2\/tags?post=189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}