mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-01 13:41:48 +01:00
Updated the table schemas in db with the new fields required for the multi-user facility. The MySQL and Postgresql versions are for reference only, as users installing or upgrading and using either of those databases can use the command 'rake migrate' to populate or update their database with the correct schema.
Users of SQLite/SQLite3 will have to use the schema to update/populate their database manually. For now... git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@133 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
47a60277ab
commit
fa795bf066
3 changed files with 66 additions and 42 deletions
|
|
@ -1,11 +1,9 @@
|
|||
-- CocoaMySQL dump
|
||||
-- Version 0.5
|
||||
-- http://cocoamysql.sourceforge.net
|
||||
-- NB: This schema should be redundant, and is just included for reference. If you are
|
||||
-- using MySQL, you can just issue the following commands at your command prompt to create
|
||||
-- the tables in the database you've specified in db/database.yml:
|
||||
--
|
||||
-- Host: localhost (MySQL 4.0.20-max)
|
||||
-- Database: todo
|
||||
-- Generation Time: 2005-03-02 15:39:14 +0000
|
||||
-- ************************************************************
|
||||
-- cd /PATH/TO/TRACKS
|
||||
-- rake migrate
|
||||
|
||||
-- Dump of table contexts
|
||||
-- ------------------------------------------------------------
|
||||
|
|
@ -13,12 +11,11 @@
|
|||
CREATE TABLE `contexts` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`name` varchar(255) NOT NULL default '',
|
||||
`hide` tinyint(4) NOT NULL default '0',
|
||||
`position` int(11) NOT NULL,
|
||||
`position` int(11) NOT NULL default '0',
|
||||
`hide` tinyint(1) default '0',
|
||||
`user_id` int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=MyISAM;
|
||||
|
||||
|
||||
) TYPE=InnoDB;
|
||||
|
||||
-- Dump of table projects
|
||||
-- ------------------------------------------------------------
|
||||
|
|
@ -26,55 +23,59 @@ CREATE TABLE `contexts` (
|
|||
CREATE TABLE `projects` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`name` varchar(255) NOT NULL default '',
|
||||
`position` int(11) NOT NULL,
|
||||
`done` tinyint(4) NOT NULL default '0',
|
||||
`position` int(11) NOT NULL default '0',
|
||||
`done` tinyint(1) default '0',
|
||||
`user_id` int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=InnoDB;
|
||||
|
||||
-- Dump of table schema_info
|
||||
-- ------------------------------------------------------------
|
||||
|
||||
CREATE TABLE `schema_info` (
|
||||
`version` int(11) default NULL
|
||||
) TYPE=MyISAM;
|
||||
|
||||
|
||||
|
||||
-- Dump of table todos
|
||||
-- ------------------------------------------------------------
|
||||
|
||||
CREATE TABLE `todos` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`name` varchar(255) NOT NULL default '',
|
||||
`context_id` int(11) NOT NULL default '0',
|
||||
`description` varchar(100) NOT NULL default '',
|
||||
`project_id` int(11) default NULL,
|
||||
`description` varchar(255) NOT NULL default '',
|
||||
`notes` text,
|
||||
`done` tinyint(4) NOT NULL default '0',
|
||||
`created` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`done` tinyint(1) NOT NULL default '0',
|
||||
`created_at` datetime default NULL,
|
||||
`due` date default NULL,
|
||||
`completed` datetime default NULL,
|
||||
`project_id` int(11) default NULL,
|
||||
`user_id` int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=MyISAM;
|
||||
|
||||
|
||||
) TYPE=InnoDB;
|
||||
|
||||
-- Dump of table users
|
||||
-- ------------------------------------------------------------
|
||||
|
||||
CREATE TABLE `users` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`login` varchar(80) default NULL,
|
||||
`password` varchar(40) default NULL,
|
||||
`login` varchar(80) NOT NULL default '',
|
||||
`password` varchar(40) NOT NULL default '',
|
||||
`word` varchar(255) default NULL,
|
||||
`is_admin` tinyint(4) NOT NULL default '0',
|
||||
`is_admin` tinyint(1) NOT NULL default '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=MyISAM;
|
||||
|
||||
) TYPE=InnoDB;
|
||||
|
||||
-- Dump of table notes
|
||||
-- ------------------------------------------------------------
|
||||
|
||||
CREATE TABLE `notes` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`user_id` int(11) NOT NULL default '0',
|
||||
`project_id` int(11) NOT NULL default '0',
|
||||
`body` text,
|
||||
`created_at` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`created_at` datetime default '0000-00-00 00:00:00',
|
||||
`updated_at` datetime default '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=MyISAM;
|
||||
|
||||
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=InnoDB;
|
||||
|
||||
|
|
@ -1,3 +1,10 @@
|
|||
-- NB: This schema should be redundant, and is just included for reference. If you are
|
||||
-- using Postgresql, you can just issue the following commands at your command prompt to create
|
||||
-- the tables in the database you've specified in db/database.yml:
|
||||
--
|
||||
-- cd /PATH/TO/TRACKS
|
||||
-- rake migrate
|
||||
|
||||
\connect tracks;
|
||||
|
||||
drop table contexts;
|
||||
|
|
@ -5,7 +12,8 @@ create table contexts (
|
|||
id serial not null,
|
||||
name varchar(255) not null default '',
|
||||
hide int not null default 0,
|
||||
position int NOT NULL,
|
||||
position int not null,
|
||||
user_id int not null default 0,
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
|
|
@ -17,14 +25,19 @@ drop table projects;
|
|||
create table projects (
|
||||
id serial not null,
|
||||
name varchar(255) not null default '',
|
||||
position int NOT NULL,
|
||||
position int not null,
|
||||
done int not null default 0,
|
||||
user_id int not null default 0,
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
-- Set the sequence to the proper value
|
||||
select setval('projects_id_seq', (select max(id) from projects));
|
||||
|
||||
create table schema_info (
|
||||
version int default null
|
||||
);
|
||||
|
||||
drop table todos;
|
||||
create table todos (
|
||||
id serial not null,
|
||||
|
|
@ -32,10 +45,11 @@ create table todos (
|
|||
description varchar(100) not null default '',
|
||||
notes text,
|
||||
done int not null default 0,
|
||||
created timestamp not null default now(),
|
||||
created_at timestamp not null default now(),
|
||||
due date default null,
|
||||
completed timestamp default null,
|
||||
project_id int default null,
|
||||
user_id int not null default 0,
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
|
|
@ -61,6 +75,7 @@ create table notes (
|
|||
body text,
|
||||
created_at timestamp default null,
|
||||
updated_at timestamp default null,
|
||||
user_id int not null default 0,
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
-- SQLite dump
|
||||
-- ************************************************************
|
||||
-- ------------------------------------------------------------
|
||||
|
||||
-- Dump of table contexts
|
||||
-- ------------------------------------------------------------
|
||||
|
|
@ -8,7 +8,8 @@ CREATE TABLE 'contexts' (
|
|||
'id' INTEGER PRIMARY KEY,
|
||||
'name' varchar(255) NOT NULL default '',
|
||||
'hide' tinyint(4) NOT NULL default '0',
|
||||
'position' int NOT NULL
|
||||
'position' int NOT NULL,
|
||||
'user_id' INTEGER NOT NULL default '0'
|
||||
) ;
|
||||
|
||||
|
||||
|
|
@ -20,10 +21,15 @@ CREATE TABLE 'projects' (
|
|||
'id' INTEGER PRIMARY KEY,
|
||||
'name' varchar(255) NOT NULL default '',
|
||||
'position' int NOT NULL,
|
||||
'done' tinyint(4) NOT NULL default '0'
|
||||
'done' tinyint(4) NOT NULL default '0',
|
||||
'user_id' INTEGER NOT NULL default '0'
|
||||
) ;
|
||||
|
||||
-- Dump of table schema_info
|
||||
|
||||
CREATE TABLE 'schema_info' (
|
||||
'version' INTEGER default NULL
|
||||
)
|
||||
|
||||
-- Dump of table todos
|
||||
-- ------------------------------------------------------------
|
||||
|
|
@ -34,10 +40,11 @@ CREATE TABLE 'todos' (
|
|||
'description' varchar(100) NOT NULL default '',
|
||||
'notes' text,
|
||||
'done' tinyint(4) NOT NULL default '0',
|
||||
'created' datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
'created_at' datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
'due' date default NULL,
|
||||
'completed' datetime default NULL,
|
||||
'project_id' int(11) default NULL
|
||||
'project_id' int(11) default NULL,
|
||||
'user_id' INTEGER NOT NULL default '0'
|
||||
) ;
|
||||
|
||||
|
||||
|
|
@ -61,6 +68,7 @@ CREATE TABLE 'notes' (
|
|||
'project_id' int(11) NOT NULL default '0',
|
||||
'body' text,
|
||||
'created_at' datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
'updated_at' datetime default '0000-00-00 00:00:00'
|
||||
'updated_at' datetime default '0000-00-00 00:00:00',
|
||||
'user_id' INTEGER NOT NULL default '0'
|
||||
) ;
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue