From c506c00cb715bc971ca53096e93528b6228e7149 Mon Sep 17 00:00:00 2001 From: bsag Date: Sat, 4 Mar 2006 12:51:23 +0000 Subject: [PATCH] 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 --- tracks/db/migrate/1_create_tracks_db.rb | 10 +++++----- tracks/db/migrate/4_notes.rb | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tracks/db/migrate/1_create_tracks_db.rb b/tracks/db/migrate/1_create_tracks_db.rb index 2ceaf1fd..86d66f9b 100644 --- a/tracks/db/migrate/1_create_tracks_db.rb +++ b/tracks/db/migrate/1_create_tracks_db.rb @@ -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 diff --git a/tracks/db/migrate/4_notes.rb b/tracks/db/migrate/4_notes.rb index cd5f86f2..b19be711 100644 --- a/tracks/db/migrate/4_notes.rb +++ b/tracks/db/migrate/4_notes.rb @@ -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