Last active
December 18, 2015 13:38
-
-
Save 0xdevalias/5790864 to your computer and use it in GitHub Desktop.
Things I learned the hard way with Rails # 1. Generate your model, make all manual edits, and only AFTER you have done this, run rake db:migrate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rails g model identity name:string email:string password_digest:string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateIdentities < ActiveRecord::Migration | |
def change | |
create_table :identities do |t| | |
t.string :name | |
t.string :email | |
t.string :password_digest | |
t.timestamps | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateIdentities < ActiveRecord::Migration | |
def change | |
create_table :identities do |t| | |
t.string :name, :null => false | |
t.string :email, :null => false | |
t.string :password_digest, :null => false | |
t.timestamps | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rake db:migrate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment