Sha256: 41fbc0a11d3bc5e7b4300984a59f19f31337c22d4a2c71d4b7594d9fbdb324c3

Contents?: true

Size: 641 Bytes

Versions: 7

Compression:

Stored size: 641 Bytes

Contents

class RelaxUserUniquenessOnEmailAndSiteId < ActiveRecord::Migration
  def migrate(direction)
    super
    # Create default Site
    Comfy::Cms::Site.reset_column_information
    Cms::Fortress::Role.reset_column_information
    Comfy::Cms::Site.create!(label: "Default", identifier: "default")
    # Create default cms-admin user
    Cms::Fortress::User.create!(:email => 'admin@cmsfortress.com', :password => '1234qwer', :password_confirmation => '1234qwer', :type_id => 1) if direction == :up
  end

  def change
    remove_index :cms_fortress_users, :email
    add_index :cms_fortress_users, [:email, :site_id], :unique => true
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cms-fortress-1.3.15 db/migrate/08_relax_user_uniqueness_on_email_and_site_id.rb
cms-fortress-1.3.14 db/migrate/08_relax_user_uniqueness_on_email_and_site_id.rb
cms-fortress-1.3.13 db/migrate/08_relax_user_uniqueness_on_email_and_site_id.rb
cms-fortress-1.3.12 db/migrate/08_relax_user_uniqueness_on_email_and_site_id.rb
cms-fortress-1.3.11 db/migrate/08_relax_user_uniqueness_on_email_and_site_id.rb
cms-fortress-1.3.10 db/migrate/08_relax_user_uniqueness_on_email_and_site_id.rb
cms-fortress-1.3.9 db/migrate/08_relax_user_uniqueness_on_email_and_site_id.rb