From 8334de1d7baf82fe74302857d9f696b35e4e055e Mon Sep 17 00:00:00 2001 From: hjp Date: Wed, 19 Aug 2009 11:33:12 +0000 Subject: [PATCH] versions split into versions2 and instances. --- doc/schema.mysql | 59 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 47 insertions(+), 12 deletions(-) diff --git a/doc/schema.mysql b/doc/schema.mysql index 55ad345..379395e 100644 --- a/doc/schema.mysql +++ b/doc/schema.mysql @@ -2,7 +2,7 @@ -- -- Host: localhost Database: simba -- ------------------------------------------------------ --- Server version 5.0.32-Debian_7etch1 +-- Server version 5.0.51a-24+lenny1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -20,6 +20,8 @@ -- DROP TABLE IF EXISTS `archived_versions`; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; CREATE TABLE `archived_versions` ( `id` int(11) NOT NULL auto_increment, `volume` int(11) default NULL, @@ -28,12 +30,15 @@ CREATE TABLE `archived_versions` ( `offset` bigint(20) default NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +SET character_set_client = @saved_cs_client; -- -- Table structure for table `files` -- DROP TABLE IF EXISTS `files`; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; CREATE TABLE `files` ( `id` int(11) NOT NULL auto_increment, `path` text, @@ -41,12 +46,15 @@ CREATE TABLE `files` ( PRIMARY KEY (`id`), KEY `files_path_index` (`path`(200)) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +SET character_set_client = @saved_cs_client; -- -- Table structure for table `filesets` -- DROP TABLE IF EXISTS `filesets`; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; CREATE TABLE `filesets` ( `id` int(11) NOT NULL auto_increment, `host` varchar(255) default NULL, @@ -54,12 +62,37 @@ CREATE TABLE `filesets` ( `options` text, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +SET character_set_client = @saved_cs_client; + +-- +-- Table structure for table `instances` +-- + +DROP TABLE IF EXISTS `instances`; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +CREATE TABLE `instances` ( + `id` int(11) NOT NULL auto_increment, + `file` int(11) default NULL, + `file_id` varchar(255) default NULL, + `date` int(11) default NULL, + `online` tinyint(1) default NULL, + `session` int(11) default NULL, + `version` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `instances_session_file_idx` (`session`,`file`), + KEY `instances_file_session_idx` (`file`,`session`), + KEY `instances_version_idx` (`version`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +SET character_set_client = @saved_cs_client; -- -- Table structure for table `sessions` -- DROP TABLE IF EXISTS `sessions`; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; CREATE TABLE `sessions` ( `id` int(11) NOT NULL auto_increment, `start_date` int(11) default NULL, @@ -67,16 +100,17 @@ CREATE TABLE `sessions` ( `prefix` varchar(255) default NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +SET character_set_client = @saved_cs_client; -- --- Table structure for table `versions` +-- Table structure for table `versions2` -- -DROP TABLE IF EXISTS `versions`; -CREATE TABLE `versions` ( +DROP TABLE IF EXISTS `versions2`; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +CREATE TABLE `versions2` ( `id` int(11) NOT NULL auto_increment, - `file` int(11) default NULL, - `file_id` varchar(255) default NULL, `file_type` char(1) default NULL, `file_size` bigint(20) default NULL, `file_mtime` int(11) default NULL, @@ -85,21 +119,21 @@ CREATE TABLE `versions` ( `file_acl` varchar(255) default NULL, `file_unix_bits` set('setuid','setgid','sticky') default NULL, `file_rdev` int(11) default NULL, - `date` int(11) default NULL, `checksum` varchar(255) default NULL, - `online` tinyint(1) default NULL, `file_linktarget` text, - `session` int(11) default NULL, PRIMARY KEY (`id`), - KEY `session` (`session`,`file`), - KEY `versions_checksum_idx` (`checksum`) + KEY `versions2_content_idx` (`checksum`,`file_mtime`), + KEY `versions2_content2_idx` (`file_type`,`file_mtime`,`checksum`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +SET character_set_client = @saved_cs_client; -- -- Table structure for table `volumes` -- DROP TABLE IF EXISTS `volumes`; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; CREATE TABLE `volumes` ( `id` int(11) NOT NULL auto_increment, `label` varchar(255) default NULL, @@ -108,6 +142,7 @@ CREATE TABLE `volumes` ( `blocksize` int(11) default NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +SET character_set_client = @saved_cs_client; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -118,4 +153,4 @@ CREATE TABLE `volumes` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2007-11-17 19:36:25 +-- Dump completed on 2009-08-19 11:29:50