Sha256: 5117ae8f78a17f3d7ea6401c7d8edc7b9ea78ca9aca484a606cd5c34ecd33be2

Contents?: true

Size: 875 Bytes

Versions: 1

Compression:

Stored size: 875 Bytes

Contents

require "jobshop/helpers/migration.rb"

class CreateUsers < ActiveRecord::Migration[5.1]
  include Jobshop::Helpers::Migration

  def change
    create_table :jobshop_users, id: false do |t|
      t.uuid :organization_id, null: false
      t.uuid :user_id, null: false, default: "gen_random_uuid()"
      t.index [ :organization_id, :user_id ], unique: true,
        name: :idx_jobshop_users_pkey

      t.citext :email, null: false
      t.index [ :organization_id, :email ], unique: true

      t.string :forename
      t.string :surname
      t.string :job_title
      t.string :email_authentication_token, index: { unique: true }
      t.datetime :email_authentication_token_sent_at, :datetime

      t.string :password_digest, null: false, default: ""

      t.timestamps
    end

    idx_table_name_pkey "jobshop_users"
    fk_organization_id "jobshop_users"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jobshop-0.0.157 db/migrate/20171216021717_create_users.rb