 <p>It appears that you are using this database migration solely for populating the data. </p> <p>Database migrations are meant for changing the database schema, not for populating the database (though you can add some logic to populate the database after the change; for example, if you add a column - role to users table, you can add some custom logic to populate the newly added field for existing entries in users table). Refer to rails api - <a href="http://guides.rubyonrails.org/migrations.html" rel="nofollow">migrations</a> for details. </p> <p>If you forgot add the code to populate the database in your previous database migration, you can undo the previous migration and apply it again using: </p> <pre><code>rake db:rollback ... Edit the previous migration ..Add the code to populate rake db:migrate </code></pre> <p>If you just want to populate the database, you should seed the database instead. Watch <a href="http://railscasts.com/episodes/179-seed-data" rel="nofollow">this railscast</a> for more information.</p> <p>EDIT: To seed the database: </p> <p>Create a file called db/seeds.rb<br> Add the record creation code like this: </p> <pre><code>['Sampath', 'Suresh'].each do |name| User.create(role: 'admin', username: name) end </code></pre> <p>Then, </p> <pre><code>rake db:seed </code></pre> <p>This will read the seeds.rb and populate the database.</p>