Merge pull request #1136 from stephankaag/update_migrations_rails4
Update migrations to be compatible with Rails 4
This commit is contained in:
commit
cb7f540568
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue