Sha256: ac0ba9f177e483aff2b67b868732a9bcb2b89600f91f202d53527b61319da2f6

Contents?: true

Size: 558 Bytes

Versions: 10

Compression:

Stored size: 558 Bytes

Contents

<% if activerecord_adapter == "postgresql" -%>
enable_extension "citext"

<% end -%>
create_table :<%= table_prefix.pluralize %><%= primary_key_type %> do |t|
  t.integer :status, null: false, default: 1
<% case activerecord_adapter -%>
<% when "postgresql" -%>
  t.citext :email, null: false
<% else -%>
  t.string :email, null: false
<% end -%>
<% case activerecord_adapter -%>
<% when "postgresql", "sqlite3" -%>
  t.index :email, unique: true, where: "status IN (1, 2)"
<% else -%>
  t.index :email, unique: true
<% end -%>
  t.string :password_hash
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rodauth-rails-1.15.2 lib/generators/rodauth/migration/active_record/base.erb
rodauth-rails-1.15.1 lib/generators/rodauth/migration/active_record/base.erb
rodauth-rails-1.15.0 lib/generators/rodauth/migration/active_record/base.erb
rodauth-rails-1.14.0 lib/generators/rodauth/migration/active_record/base.erb
rodauth-rails-1.13.0 lib/generators/rodauth/migration/active_record/base.erb
rodauth-rails-1.12.0 lib/generators/rodauth/migration/active_record/base.erb
rodauth-rails-1.11.0 lib/generators/rodauth/migration/active_record/base.erb
rodauth-rails-1.10.0 lib/generators/rodauth/migration/active_record/base.erb
rodauth-rails-1.9.0 lib/generators/rodauth/migration/active_record/base.erb
rodauth-rails-1.8.0 lib/generators/rodauth/migration/active_record/base.erb