title: Getting an error message when I attempt to run seed script
body: <pre><code>Rails 5.1
  </code></pre>
  
  <p>In my seeds.rb file I have:</p>
  
  <pre><code>user = User.new(
      :email =&gt;'random@myapp.com',
      :password =&gt;'xK#986754',
      :password_confirmation =&gt;'xK#986754',
      :first_name =&gt;'John',
      :last_name =&gt;'Smith',
      :role =&gt; 1
      :approved =&gt; true
  )
  user.skip_invitation
  user.save
  </code></pre>
  
  <p>In my user.rb molde, I have:</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
  
    enum role: [:user, :vip, :admin]
    after_initialize :set_default_role, :if =&gt; :new_record?
  
  
    # Include default devise modules. Others available are:
    # :confirmable, :lockable, :timeoutable and :omniauthable
    devise :invitable, :database_authenticatable, :registerable,
          :recoverable, :rememberable, :trackable, :validatable
  
    attr_accessor :email, :password, :first_name, :last_name, :role, :approved
  
    validates :email, uniqueness: true, presence: true
    validates :first_name, presence: true
    validates :last_name, presence: true
    validates :role, presence: true
  
    def set_default_role
      self.role ||= :user
    end
  end
  </code></pre>
  
  <p>In my migration file, I have:</p>
  
  <pre><code>class DeviseCreateUsers &lt; ActiveRecord::Migration[5.1]
    def change
      create_table :users do |t|
  
        t.string :first_name, null: false
        t.string :last_name, null: false
        t.integer :role, null: false
        t.string :email, null: false
  
        ## Approved
        t.boolean :approved, :default =&gt; 0, :null =&gt; false
  </code></pre>
  
  <p>When I try to run the seed file, I get the following error message:</p>
  
  <pre><code>ActiveRecord::NotNullViolation: Mysql2::Error: Field 'first_name' doesn't have a default value: INSERT INTO `users` (`approved`, `created_at`, `updated_at`) VALUES (1, '2017-10-23 02:23:36', '2017-10-23 02:23:36')
  </code></pre>
  
  <p>I am obviously using the devise gem</p>
  
  <p>Any ideas?</p>