From 93cc6f63ae5c9a1166e0a26f481bef6839197b59 Mon Sep 17 00:00:00 2001 From: Stephan Kaag Date: Wed, 3 Jul 2013 21:07:13 +0200 Subject: [PATCH] Update migrations to be compatible with Rails 4 --- db/migrate/20120425145456_add_display_username_to_users.rb | 2 +- db/migrate/20120813201426_create_forum_thread_link_clicks.rb | 2 +- .../20120815004411_add_unique_index_to_forum_thread_links.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/db/migrate/20120425145456_add_display_username_to_users.rb b/db/migrate/20120425145456_add_display_username_to_users.rb index dc9402eba..9ef10657b 100644 --- a/db/migrate/20120425145456_add_display_username_to_users.rb +++ b/db/migrate/20120425145456_add_display_username_to_users.rb @@ -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 diff --git a/db/migrate/20120813201426_create_forum_thread_link_clicks.rb b/db/migrate/20120813201426_create_forum_thread_link_clicks.rb index 41eb7d009..f87202cfb 100644 --- a/db/migrate/20120813201426_create_forum_thread_link_clicks.rb +++ b/db/migrate/20120813201426_create_forum_thread_link_clicks.rb @@ -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 diff --git a/db/migrate/20120815004411_add_unique_index_to_forum_thread_links.rb b/db/migrate/20120815004411_add_unique_index_to_forum_thread_links.rb index 55352f63b..e94bcc933 100644 --- a/db/migrate/20120815004411_add_unique_index_to_forum_thread_links.rb +++ b/db/migrate/20120815004411_add_unique_index_to_forum_thread_links.rb @@ -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