Merge pull request #1136 from stephankaag/update_migrations_rails4

Update migrations to be compatible with Rails 4
This commit is contained in:
Robin Ward 2013-07-09 06:49:31 -07:00
commit cb7f540568
3 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@ class AddDisplayUsernameToUsers < ActiveRecord::Migration
add_column :users, :display_username, :string
execute "UPDATE users SET display_username = username"
execute "UPDATE users SET username = REPLACE(username, ' ', '')"
add_index :users, :username, :unique
add_index :users, :username, unique: true
end
def down

View File

@ -8,6 +8,6 @@ class CreateForumThreadLinkClicks < ActiveRecord::Migration
end
add_column :forum_thread_links, :clicks, :integer, default: 0, null: false
add_index :forum_thread_link_clicks, :forum_thread_link_id, as: :by_link
add_index :forum_thread_link_clicks, :forum_thread_link_id, name: :by_link
end
end

View File

@ -8,6 +8,6 @@ class AddUniqueIndexToForumThreadLinks < ActiveRecord::Migration
AND ftl2.id < forum_thread_links.id"
# Add the unique index
add_index :forum_thread_links, [:forum_thread_id, :post_id, :url], unique: true, as: 'unique_post_links'
add_index :forum_thread_links, [:forum_thread_id, :post_id, :url], unique: true, name: 'unique_post_links'
end
end