Sha256: 85eeb602c6c745ed5736b25f1434c7f0a0259ca6f83a652aaf6a36b1df951f24

Contents?: true

Size: 473 Bytes

Versions: 7

Compression:

Stored size: 473 Bytes

Contents

class CreateGroups < ActiveRecord::Migration
  def change
    create_table :groups do |t|
      t.string :name
      t.timestamps
    end

    add_column :permissions, :group_id, :integer
    add_index :permissions, :group_id

    create_table :groups_users, id: false do |t|
      t.references :group
      t.references :user
    end
    add_index :groups_users, :group_id
    add_index :groups_users, :user_id
    add_index :groups_users, [:group_id, :user_id]
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
fat_free_crm-0.14.2 db/migrate/20120406082136_create_groups.rb
fat_free_crm-0.14.1 db/migrate/20120406082136_create_groups.rb
fat_free_crm-0.15.0.beta.2 db/migrate/20120406082136_create_groups.rb
fat_free_crm-0.15.0.beta db/migrate/20120406082136_create_groups.rb
fat_free_crm-0.14.0 db/migrate/20120406082136_create_groups.rb
reduced_fat_crm-0.15.0.beta db/migrate/20120406082136_create_groups.rb
reduced_fat_crm-0.14.0 db/migrate/20120406082136_create_groups.rb