Migration File

Let's add some constraints for the users' parameters.

Default migration file

The migration file contained in the db/migrate folder that was generated by rails generate model contains the migration that describes the changes which will be made to the database. This file should look like this:

Press + to interact
class CreateUsers < ActiveRecord::Migration[6.0]
def change
create_table :users do |t|
t.string :email
t.string :password_digest
t.timestamps
end
end
end

Note: The inserted date at the beginning of the migration file name should be ...