Sha256: f25eb75b5ac13ab545d15c821345ad77a7d70dea32120bda4ae6a597c006abda

Contents?: true

Size: 1.47 KB

Versions: 51

Compression:

Stored size: 1.47 KB

Contents

class AddUsersTables < ActiveRecord::Migration
  
  def self.up
    create_table "users" do |t|
      t.column "username",          :string
      t.column "password_hash",     :string, :limit => 100
      
      t.column "first_name",        :string, :limit => 100
      t.column "last_name",         :string, :limit => 100
      
      t.column "dynamic_fields",    :text
      
      t.column "active",            :integer, :default => 1, :null => false
      t.column "is_superuser",      :integer, :default => 0, :null => false
      
      t.column "created_on",        :timestamp
      t.column "updated_on",        :timestamp
    end
    add_index "users", ["username"], :name => "UN_users_username", :unique => true
    
    create_table "user_groups" do |t|
      t.column "name",              :string
      
      t.column "created_on",        :timestamp
      t.column "updated_on",        :timestamp
    end
    add_index "user_groups", ["name"], :name => "UN_user_groups_name", :unique => true
    
    create_table "user_group_memberships", :id => false do |t|
      t.column "user_id",           :integer, :null => false
      t.column "user_group_id",     :integer, :null => false
      t.column "created_on",        :timestamp
    end
    execute 'alter table user_group_memberships add constraint PK_user_group_memberships primary key (user_id, user_group_id)'
  end
  
  def self.down
    drop_table "user_group_memberships"
    drop_table "user_groups"
    drop_table "users"
  end
  
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
imagine_cms-4.2.4 db/migrate/20121115083811_add_users_tables.rb
imagine_cms-4.1.4 db/migrate/20121115083811_add_users_tables.rb
imagine_cms-4.2.3 db/migrate/20121115083811_add_users_tables.rb
imagine_cms-4.2.2 db/migrate/20121115083811_add_users_tables.rb
imagine_cms-4.2.1 db/migrate/20121115083811_add_users_tables.rb
imagine_cms-4.2.0 db/migrate/20121115083811_add_users_tables.rb
imagine_cms-4.1.3 db/migrate/20121115083811_add_users_tables.rb
imagine_cms-4.1.2 db/migrate/20121115083811_add_users_tables.rb
imagine_cms-4.1.1 db/migrate/20121115083811_add_users_tables.rb
imagine_cms-4.1.0 db/migrate/20121115083811_add_users_tables.rb
imagine_cms-4.0.1 db/migrate/20121115083811_add_users_tables.rb
imagine_cms-4.0.0 db/migrate/20121115083811_add_users_tables.rb
imagine_cms-3.0.33 db/migrate/20121115083811_add_users_tables.rb
imagine_cms-3.0.32 db/migrate/20121115083811_add_users_tables.rb
imagine_cms-3.0.31 db/migrate/20121115083811_add_users_tables.rb
imagine_cms-3.0.30 db/migrate/20121115083811_add_users_tables.rb
imagine_cms-3.0.29 db/migrate/20121115083811_add_users_tables.rb
imagine_cms-3.0.28 db/migrate/20121115083811_add_users_tables.rb
imagine_cms-3.0.27 db/migrate/20121115083811_add_users_tables.rb
imagine_cms-3.0.26 db/migrate/20121115083811_add_users_tables.rb