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