Class: AddUsernameUser
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- AddUsernameUser
- Defined in:
- lib/generators/squeezer/templates/db/migrate/add_username_user.rb
Class Method Summary collapse
Class Method Details
.down ⇒ Object
7 8 9 10 |
# File 'lib/generators/squeezer/templates/db/migrate/add_username_user.rb', line 7 def self.down remove_index :users, :username remove_column :users, :username end |
.up ⇒ Object
2 3 4 5 |
# File 'lib/generators/squeezer/templates/db/migrate/add_username_user.rb', line 2 def self.up add_column :users, :username, :string add_index :users, :username, :unique => true end |