Sha256: ae4b7b08096bb9a38c4eb73b9c96ee16d67633052d6e1a507fa6fcd4a7e0e86f

Contents?: true

Size: 728 Bytes

Versions: 12

Compression:

Stored size: 728 Bytes

Contents

class CreateUsers < ActiveRecord::Migration
  def change
    create_table :users do |t|
      # References to user role and user origin provider
      t.references :user_role
      t.integer :origin_provider_id
      
      # Required attributes for user
      t.string :first_name
      t.string :last_name
      t.string :email
      t.string :image_url
      t.boolean :has_provider, :null => false, :default => false

      # For password
      t.string :password_digest

      # Extending with your own data for user
      # here

      t.timestamps
    end

    # Indices
    change_table :users do |t|
      t.index :email, :unique => true
      t.index :user_role_id
      t.index :origin_provider_id
    end
  end


end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
authorizme-1.0.0 lib/generators/authorizme/templates/migrations/1_create_users.rb
authorizme-0.0.11 lib/generators/authorizme/templates/migrations/1_create_users.rb
authorizme-0.0.10 lib/generators/authorizme/templates/migrations/1_create_users.rb
authorizme-0.0.9 lib/generators/authorizme/templates/migrations/1_create_users.rb
authorizme-0.0.8 lib/generators/authorizme/templates/migrations/1_create_users.rb
authorizme-0.0.7 lib/generators/authorizme/templates/migrations/1_create_users.rb
authorizme-0.0.6 lib/generators/authorizme/templates/migrations/1_create_users.rb
authorizme-0.0.5 lib/generators/authorizme/templates/migrations/1_create_users.rb
authorizme-0.0.4 lib/generators/authorizme/templates/migrations/1_create_users.rb
authorizme-0.0.3 lib/generators/authorizme/templates/migrations/1_create_users.rb
authorizme-0.0.2 lib/generators/authorizme/templates/migrations/1_create_users.rb
authorizme-0.0.1.alpha lib/generators/authorizme/templates/migrations/1_create_users.rb