diff --git a/Database-schema.textile b/Database-schema.textile new file mode 100644 index 0000000..248f72e --- /dev/null +++ b/Database-schema.textile @@ -0,0 +1,317 @@ +h1. Database schema + +for people who do not have shell access or and are not able to use rake db:migrate the is the following sql to create databases + +Please not that this the the schema for 1.8devel, but it should work fine for 1.7 + +[code] +-- MySQL dump 10.11 +-- +-- Host: localhost Database: tracks_prod +-- ------------------------------------------------------ +-- Server version 5.0.84 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `contexts` +-- + +DROP TABLE IF EXISTS `contexts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `contexts` ( + `id` int(11) NOT NULL auto_increment, + `name` varchar(255) NOT NULL, + `position` int(11) default '0', + `hide` tinyint(1) default '0', + `user_id` int(11) default '1', + `created_at` datetime default NULL, + `updated_at` datetime default NULL, + PRIMARY KEY (`id`), + KEY `index_contexts_on_user_id` (`user_id`), + KEY `index_contexts_on_user_id_and_name` (`user_id`,`name`) +) ENGINE=InnoDB AUTO_INCREMENT=64 DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `notes` +-- + +DROP TABLE IF EXISTS `notes`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `notes` ( + `id` int(11) NOT NULL auto_increment, + `user_id` int(11) NOT NULL, + `project_id` int(11) NOT NULL, + `body` text, + `created_at` datetime default NULL, + `updated_at` datetime default NULL, + PRIMARY KEY (`id`), + KEY `index_notes_on_project_id` (`project_id`), + KEY `index_notes_on_user_id` (`user_id`) +) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `open_id_authentication_associations` +-- + +DROP TABLE IF EXISTS `open_id_authentication_associations`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `open_id_authentication_associations` ( + `id` int(11) NOT NULL auto_increment, + `issued` int(11) default NULL, + `lifetime` int(11) default NULL, + `handle` varchar(255) default NULL, + `assoc_type` varchar(255) default NULL, + `server_url` blob, + `secret` blob, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `open_id_authentication_nonces` +-- + +DROP TABLE IF EXISTS `open_id_authentication_nonces`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `open_id_authentication_nonces` ( + `id` int(11) NOT NULL auto_increment, + `timestamp` int(11) NOT NULL, + `server_url` varchar(255) default NULL, + `salt` varchar(255) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `preferences` +-- + +DROP TABLE IF EXISTS `preferences`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `preferences` ( + `id` int(11) NOT NULL auto_increment, + `user_id` int(11) NOT NULL, + `date_format` varchar(40) NOT NULL default '%d/%m/%Y', + `week_starts` int(11) NOT NULL default '0', + `show_number_completed` int(11) NOT NULL default '5', + `staleness_starts` int(11) NOT NULL default '7', + `show_completed_projects_in_sidebar` tinyint(1) NOT NULL default '1', + `show_hidden_contexts_in_sidebar` tinyint(1) NOT NULL default '1', + `due_style` int(11) NOT NULL default '0', + `admin_email` varchar(255) NOT NULL default 'butshesagirl@rousette.org.uk', + `refresh` int(11) NOT NULL default '0', + `verbose_action_descriptors` tinyint(1) NOT NULL default '0', + `show_hidden_projects_in_sidebar` tinyint(1) NOT NULL default '1', + `time_zone` varchar(255) NOT NULL default 'London', + `show_project_on_todo_done` tinyint(1) NOT NULL default '0', + `title_date_format` varchar(255) NOT NULL default '%A, %d %B %Y', + `mobile_todos_per_page` int(11) NOT NULL default '6', + `sms_email` varchar(255) default NULL, + `sms_context_id` int(11) default NULL, + PRIMARY KEY (`id`), + KEY `index_preferences_on_user_id` (`user_id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `projects` +-- + +DROP TABLE IF EXISTS `projects`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `projects` ( + `id` int(11) NOT NULL auto_increment, + `name` varchar(255) NOT NULL, + `position` int(11) default '0', + `user_id` int(11) default '1', + `description` text, + `state` varchar(20) NOT NULL default 'active', + `created_at` datetime default NULL, + `updated_at` datetime default NULL, + `default_context_id` int(11) default NULL, + `completed_at` datetime default NULL, + `default_tags` varchar(255) default NULL, + PRIMARY KEY (`id`), + KEY `index_projects_on_user_id` (`user_id`), + KEY `index_projects_on_user_id_and_name` (`user_id`,`name`) +) ENGINE=InnoDB AUTO_INCREMENT=190 DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `recurring_todos` +-- + +DROP TABLE IF EXISTS `recurring_todos`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `recurring_todos` ( + `id` int(11) NOT NULL auto_increment, + `user_id` int(11) default '1', + `context_id` int(11) NOT NULL, + `project_id` int(11) default NULL, + `description` varchar(255) NOT NULL, + `notes` text, + `state` varchar(20) NOT NULL default 'active', + `start_from` datetime default NULL, + `ends_on` varchar(255) default NULL, + `end_date` datetime default NULL, + `number_of_occurences` int(11) default NULL, + `occurences_count` int(11) default '0', + `target` varchar(255) default NULL, + `show_from_delta` int(11) default NULL, + `recurring_period` varchar(255) default NULL, + `recurrence_selector` int(11) default NULL, + `every_other1` int(11) default NULL, + `every_other2` int(11) default NULL, + `every_other3` int(11) default NULL, + `every_day` varchar(255) default NULL, + `only_work_days` tinyint(1) default '0', + `every_count` int(11) default NULL, + `weekday` int(11) default NULL, + `completed_at` datetime default NULL, + `created_at` datetime default NULL, + `updated_at` datetime default NULL, + `show_always` tinyint(1) default NULL, + PRIMARY KEY (`id`), + KEY `index_recurring_todos_on_user_id` (`user_id`), + KEY `index_recurring_todos_on_state` (`state`) +) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `schema_migrations` +-- + +DROP TABLE IF EXISTS `schema_migrations`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `schema_migrations` ( + `version` varchar(255) NOT NULL, + UNIQUE KEY `unique_schema_migrations` (`version`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `sessions` +-- + +DROP TABLE IF EXISTS `sessions`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `sessions` ( + `id` int(11) NOT NULL auto_increment, + `session_id` varchar(255) default NULL, + `data` text, + `updated_at` datetime default NULL, + PRIMARY KEY (`id`), + KEY `sessions_session_id_index` (`session_id`) +) ENGINE=InnoDB AUTO_INCREMENT=46388 DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `taggings` +-- + +DROP TABLE IF EXISTS `taggings`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `taggings` ( + `id` int(11) NOT NULL auto_increment, + `taggable_id` int(11) default NULL, + `tag_id` int(11) default NULL, + `taggable_type` varchar(255) default NULL, + PRIMARY KEY (`id`), + KEY `index_taggings_on_tag_id_and_taggable_id_and_taggable_type` (`tag_id`,`taggable_id`,`taggable_type`), + KEY `index_taggings_on_taggable_id_and_taggable_type` (`taggable_id`,`taggable_type`), + KEY `index_taggings_on_tag_id` (`tag_id`) +) ENGINE=InnoDB AUTO_INCREMENT=12747 DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `tags` +-- + +DROP TABLE IF EXISTS `tags`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `tags` ( + `id` int(11) NOT NULL auto_increment, + `name` varchar(255) default NULL, + `created_at` datetime default NULL, + `updated_at` datetime default NULL, + PRIMARY KEY (`id`), + KEY `index_tags_on_name` (`name`) +) ENGINE=InnoDB AUTO_INCREMENT=1026 DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `todos` +-- + +DROP TABLE IF EXISTS `todos`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `todos` ( + `id` int(11) NOT NULL auto_increment, + `context_id` int(11) NOT NULL, + `project_id` int(11) default NULL, + `description` varchar(255) NOT NULL, + `notes` text, + `created_at` datetime default NULL, + `due` datetime default NULL, + `completed_at` datetime default NULL, + `user_id` int(11) default '1', + `show_from` datetime default NULL, + `state` varchar(20) NOT NULL default 'immediate', + `recurring_todo_id` int(11) default NULL, + `updated_at` datetime default NULL, + PRIMARY KEY (`id`), + KEY `index_todos_on_user_id_and_state` (`user_id`,`state`), + KEY `index_todos_on_user_id_and_project_id` (`user_id`,`project_id`), + KEY `index_todos_on_project_id` (`project_id`), + KEY `index_todos_on_context_id` (`context_id`), + KEY `index_todos_on_user_id_and_context_id` (`user_id`,`context_id`) +) ENGINE=InnoDB AUTO_INCREMENT=4939 DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `users` +-- + +DROP TABLE IF EXISTS `users`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `users` ( + `id` int(11) NOT NULL auto_increment, + `login` varchar(80) NOT NULL, + `crypted_password` varchar(40) default NULL, + `token` varchar(255) default NULL, + `is_admin` tinyint(1) NOT NULL default '0', + `first_name` varchar(255) default NULL, + `last_name` varchar(255) default NULL, + `auth_type` varchar(255) NOT NULL default 'database', + `open_id_url` varchar(255) default NULL, + `remember_token` varchar(255) default NULL, + `remember_token_expires_at` datetime default NULL, + PRIMARY KEY (`id`), + KEY `index_users_on_login` (`login`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2009-10-09 16:28:05 + +[/code] \ No newline at end of file