Altered the migrations files to make them more compatible with Postgresql and SQLite as suggested by jmail2:

* booleans now default to false not zero
* datetimes default to 0000-01-01 00:00:00

Fixes #218.



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@200 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
bsag 2006-03-04 12:51:23 +00:00
parent d25ee6174e
commit c506c00cb7
2 changed files with 7 additions and 7 deletions

View file

@ -4,13 +4,13 @@ class CreateTracksDb < ActiveRecord::Migration
create_table :contexts do |t|
t.column :name, :string, :null => false
t.column :position, :integer, :null => false
t.column :hide, :boolean, :default => 0
t.column :hide, :boolean, :default => false
end
create_table :projects do |t|
t.column :name, :string, :null => false
t.column :position, :integer, :null => false
t.column :done, :boolean, :default => 0
t.column :done, :boolean, :default => false
end
create_table :todos do |t|
@ -18,8 +18,8 @@ class CreateTracksDb < ActiveRecord::Migration
t.column :project_id, :integer
t.column :description, :string, :null => false
t.column :notes, :text
t.column :done, :boolean, :default => 0, :null => false
t.column :created, :datetime, :default => '0000-00-00 00:00:00'
t.column :done, :boolean, :default => false, :null => false
t.column :created, :datetime, :default => '0000-01-01 00:00:00'
t.column :due, :date
t.column :completed, :datetime
end
@ -28,7 +28,7 @@ class CreateTracksDb < ActiveRecord::Migration
t.column :login, :string, :limit => 80, :null => false
t.column :password, :string, :limit => 40, :null => false
t.column :word, :string
t.column :is_admin, :boolean, :default => 0, :null => false
t.column :is_admin, :boolean, :default => false, :null => false
end
end

View file

@ -4,8 +4,8 @@ class Notes < ActiveRecord::Migration
t.column :user_id, :integer, :null => false
t.column :project_id, :integer, :null => false
t.column :body, :text
t.column :created_at, :datetime, :default => '0000-00-00 00:00:00'
t.column :updated_at, :datetime, :default => '0000-00-00 00:00:00'
t.column :created_at, :datetime, :default => '0000-01-01 00:00:00'
t.column :updated_at, :datetime, :default => '0000-01-01 00:00:00'
end
end