mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
Update migrations to be compatible with Rails 4
This commit is contained in:
parent
ba0bd934ba
commit
93cc6f63ae
3 changed files with 3 additions and 3 deletions
|
@ -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 a new issue