Sha256: 3a1fe0a09e70cdcfdd2173281b29195eeaaa4ede99dea24c7acd23beeb940211

Contents?: true

Size: 1.43 KB

Versions: 32

Compression:

Stored size: 1.43 KB

Contents

class CreateRefinerycmsAuthenticationSchema < ActiveRecord::Migration
  def self.up
    # Postgres apparently requires the roles_users table to exist before creating the roles table.
    create_table ::RolesUsers.table_name, :id => false, :force => true do |t|
      t.integer "user_id"
      t.integer "role_id"
    end

    create_table ::Role.table_name, :force => true do |t|
      t.string "title"
    end

    create_table ::UserPlugin.table_name, :force => true do |t|
      t.integer "user_id"
      t.string  "name"
      t.integer "position"
    end

    add_index ::UserPlugin.table_name, ["name"], :name => "index_#{::UserPlugin.table_name}_on_title"
    add_index ::UserPlugin.table_name, ["user_id", "name"], :name => "index_unique_#{::UserPlugin.table_name}", :unique => true

    create_table ::User.table_name, :force => true do |t|
      t.string   "login",             :null => false
      t.string   "email",             :null => false
      t.string   "crypted_password",  :null => false
      t.string   "password_salt",     :null => false
      t.string   "persistence_token"
      t.datetime "created_at"
      t.datetime "updated_at"
      t.string   "perishable_token"
    end

    add_index ::User.table_name, ["id"], :name => "index_#{::User.table_name}_on_id"
  end

  def self.down
    [::User].reject{|m|
      !(defined?(m) and m.respond_to?(:table_name))
    }.each do |model|
      drop_table model.table_name
    end
  end
end

Version data entries

32 entries across 32 versions & 2 rubygems

Version Path
refinerycms-authentication-1.0.11 db/migrate/20100913234705_create_refinerycms_authentication_schema.rb
refinerycms-authentication-1.0.10 db/migrate/20100913234705_create_refinerycms_authentication_schema.rb
refinerycms-authentication-1.0.9 db/migrate/20100913234705_create_refinerycms_authentication_schema.rb
refinerycms-authentication-1.0.8 db/migrate/20100913234705_create_refinerycms_authentication_schema.rb
refinerycms-authentication-1.0.7 db/migrate/20100913234705_create_refinerycms_authentication_schema.rb
refinerycms-authentication-1.0.5 db/migrate/20100913234705_create_refinerycms_authentication_schema.rb
refinerycms-authentication-1.0.4 db/migrate/20100913234705_create_refinerycms_authentication_schema.rb
refinerycms-authentication-1.0.3 db/migrate/20100913234705_create_refinerycms_authentication_schema.rb
refinerycms-authentication-1.0.1 db/migrate/20100913234705_create_refinerycms_authentication_schema.rb
refinerycms-authentication-1.0.0 db/migrate/20100913234705_create_refinerycms_authentication_schema.rb
refinerycms-authentication-0.9.9.22 db/migrate/20100913234705_create_refinerycms_authentication_schema.rb
refinerycms-authentication-0.9.9.21 db/migrate/20100913234705_create_refinerycms_authentication_schema.rb
refinerycms-authentication-0.9.9.20 db/migrate/20100913234705_create_refinerycms_authentication_schema.rb
refinerycms-authentication-0.9.9.19 db/migrate/20100913234705_create_refinerycms_authentication_schema.rb
refinerycms-authentication-0.9.9.18 db/migrate/20100913234705_create_refinerycms_authentication_schema.rb
refinerycms-authentication-0.9.9.17 db/migrate/20100913234705_create_refinerycms_authentication_schema.rb
refinerycms-authentication-0.9.9.16 db/migrate/20100913234705_create_refinerycms_authentication_schema.rb
refinerycms-authentication-0.9.9.15 db/migrate/20100913234705_create_refinerycms_authentication_schema.rb
refinerycms-authentication-0.9.9.14 db/migrate/20100913234705_create_refinerycms_authentication_schema.rb
refinerycms-authentication-0.9.9.13 db/migrate/20100913234705_create_refinerycms_authentication_schema.rb