aboutsummaryrefslogtreecommitdiffstats
path: root/db/migrate
diff options
context:
space:
mode:
authorXinhui2016-05-13 18:27:51 +0200
committerXinhui2016-05-13 18:27:51 +0200
commit48c8997c649fa183923164714ea916c4e6976727 (patch)
tree69005a7ba5411045c0ae15fbc3952385df628260 /db/migrate
parent24f83ed286f1a2cbc8adc3051ab319b29a8bbf79 (diff)
downloadchouette-core-48c8997c649fa183923164714ea916c4e6976727.tar.bz2
Tempset users.username to nullable
Diffstat (limited to 'db/migrate')
-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