class CreateUsers < Jennifer::Migration::Base
  def up
    create_table :users do |t|
      t.string :email, {:null => false}
      t.string :password_hash, {:null => false}
      t.string :first_name
      t.string :last_name
      t.string :company_name
      t.string :stripe_customer_id
      t.string :role, {:null => false, :default => "user"}
      t.bool :active, {:null => false, :default => true}
      t.bool :email_verified, {:null => false, :default => false}
      t.timestamps
      
      t.index :email, :unique => true
      t.index :stripe_customer_id, :unique => true
    end
  end

  def down
    drop_table :users if table_exists? :users
  end
end
