Sha256: 5374454e6662249eddfd91ac68903fb41355439cbe2076669ff32f49237343df

Contents?: true

Size: 701 Bytes

Versions: 22

Compression:

Stored size: 701 Bytes

Contents

<% if db.database_type == :postgres -%>
begin
  run "CREATE EXTENSION IF NOT EXISTS citext"
rescue NoMethodError # migration is being reverted
end

<% end -%>
create_table :<%= table_prefix.pluralize %> do
  primary_key :id, type: :Bignum
<% if db.database_type == :postgres -%>
  citext :email, null: false
  constraint :valid_email, email: /^[^,;@ \r\n]+@[^,@; \r\n]+\.[^,@; \r\n]+$/
<% else -%>
  String :email, null: false
<% end -%>
  Integer :status, null: false, default: 1
<% if db.supports_partial_indexes? -%>
  index :email, unique: true, where: { status: [1, 2] }
<% else -%>
  index :email, unique: true
<% end -%>
<% unless separate_passwords? -%>
  String :password_hash
<% end -%>
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
plutonium-0.12.14 lib/generators/pu/rodauth/migration/sequel/base.erb
plutonium-0.12.13 lib/generators/pu/rodauth/migration/sequel/base.erb
plutonium-0.12.12 lib/generators/pu/rodauth/migration/sequel/base.erb
plutonium-0.12.11 lib/generators/pu/rodauth/migration/sequel/base.erb
plutonium-0.12.10 lib/generators/pu/rodauth/migration/sequel/base.erb
plutonium-0.12.9 lib/generators/pu/rodauth/migration/sequel/base.erb
plutonium-0.12.8 lib/generators/pu/rodauth/migration/sequel/base.erb
plutonium-0.12.7 lib/generators/pu/rodauth/migration/sequel/base.erb
plutonium-0.12.5 lib/generators/pu/rodauth/migration/sequel/base.erb
plutonium-0.12.4 lib/generators/pu/rodauth/migration/sequel/base.erb
plutonium-0.12.3 lib/generators/pu/rodauth/migration/sequel/base.erb
plutonium-0.12.2 lib/generators/pu/rodauth/migration/sequel/base.erb
plutonium-0.12.1 lib/generators/pu/rodauth/migration/sequel/base.erb
plutonium-0.12.0 lib/generators/pu/rodauth/migration/sequel/base.erb
plutonium-0.11.2 lib/generators/pu/rodauth/migration/sequel/base.erb
plutonium-0.11.1 lib/generators/pu/rodauth/migration/sequel/base.erb
plutonium-0.11.0 lib/generators/pu/rodauth/migration/sequel/base.erb
plutonium-0.8.0 lib/generators/pu/rodauth/migration/sequel/base.erb
plutonium-0.6.2 lib/generators/pu/rodauth/migration/sequel/base.erb
plutonium-0.6.1 lib/generators/pu/rodauth/migration/sequel/base.erb