aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--db/migrate/20160511134824_add_username_to_users.rb13
1 files changed, 2 insertions, 11 deletions
diff --git a/db/migrate/20160511134824_add_username_to_users.rb b/db/migrate/20160511134824_add_username_to_users.rb
index 50dfda864..e9a90a890 100644
--- a/db/migrate/20160511134824_add_username_to_users.rb
+++ b/db/migrate/20160511134824_add_username_to_users.rb
@@ -1,15 +1,6 @@
class AddUsernameToUsers < ActiveRecord::Migration
- def up
- add_column :users, :username, :string, :null => false
+ def change
+ add_column :users, :username, :string, :null => true
add_index :users, :username, :unique => true
- User.all.each do |u|
- u.username = u.email
- u.save
- end
- end
-
- def down
- remove_column :users, :username, :string, :null => false
- remove_index :users, :username, :unique => true
end
end