From 98a3db040b45970b82b5ade7f25e716e871b754b Mon Sep 17 00:00:00 2001 From: andrew Date: Sun, 3 Feb 2008 05:50:41 +0000 Subject: [PATCH] indexes and created_at fields git-svn-id: http://svn.barleysodas.com/barleysodas/trunk@124 0f7b21a7-9e3a-4941-bbeb-ce5c7c368fa7 --- db/migrate/002_create_pages.rb | 4 ++++ db/migrate/003_create_beers.rb | 2 ++ db/migrate/004_create_breweries.rb | 2 ++ db/migrate/008_create_peoples.rb | 1 + db/migrate/012_create_tag_images.rb | 1 + 5 files changed, 10 insertions(+) diff --git a/db/migrate/002_create_pages.rb b/db/migrate/002_create_pages.rb index 0bebd00..fe02b23 100644 --- a/db/migrate/002_create_pages.rb +++ b/db/migrate/002_create_pages.rb @@ -7,10 +7,14 @@ class CreatePages < ActiveRecord::Migration t.column :owner_id, :integer t.column :owner_type, :string, :limit => 32 t.column :version, :integer + t.column :created_at, :timestamp + t.column :updated_at, :timestamp t.column :created_by, :integer t.column :updated_by, :integer end + add_index :pages, :title add_index :pages, :owner_id + add_index :pages, :owner_type add_index :pages, :created_by add_index :pages, :updated_by Page.create_versioned_table diff --git a/db/migrate/003_create_beers.rb b/db/migrate/003_create_beers.rb index 28d6f3a..8d3b38b 100644 --- a/db/migrate/003_create_beers.rb +++ b/db/migrate/003_create_beers.rb @@ -6,7 +6,9 @@ class CreateBeers < ActiveRecord::Migration t.column :original_gravity, :float t.column :final_gravity, :float t.column :style_id, :integer + t.column :created_at, :timestamp end + add_index :beers, :title add_index :beers, :style_id end diff --git a/db/migrate/004_create_breweries.rb b/db/migrate/004_create_breweries.rb index 195f3b3..585628f 100644 --- a/db/migrate/004_create_breweries.rb +++ b/db/migrate/004_create_breweries.rb @@ -8,9 +8,11 @@ class CreateBreweries < ActiveRecord::Migration t.column :state, :string t.column :postal_code, :string t.column :country, :string + t.column :created_at, :timestamp end add_column :beers, :brewery_id, :integer add_index :beers, :brewery_id + add_index :breweries, :title end def self.down diff --git a/db/migrate/008_create_peoples.rb b/db/migrate/008_create_peoples.rb index 7ad83cf..ee91257 100644 --- a/db/migrate/008_create_peoples.rb +++ b/db/migrate/008_create_peoples.rb @@ -5,6 +5,7 @@ class CreatePeoples < ActiveRecord::Migration t.column :role_id, :integer t.column :encrypted_password, :string, :limit => 512 t.column :salt, :string, :limit => 512 + t.column :created_at, :timestamp end add_index :peoples, :title add_index :peoples, :role_id diff --git a/db/migrate/012_create_tag_images.rb b/db/migrate/012_create_tag_images.rb index 7a6e71d..95d71aa 100644 --- a/db/migrate/012_create_tag_images.rb +++ b/db/migrate/012_create_tag_images.rb @@ -11,6 +11,7 @@ class CreateTagImages < ActiveRecord::Migration add_index :tag_images, :image_id add_index :tag_images, :tagged_id add_index :tag_images, :tagged_type + add_index :tag_images, :primary end def self.down