Sha256: 2569bc9d185e31e797e7ea867abb5b65a3e31eea79ee4ceee14425778be08f73

Contents?: true

Size: 752 Bytes

Versions: 9

Compression:

Stored size: 752 Bytes

Contents

class CreateEntityAssignments < ActiveRecord::Migration[4.2]
  def self.up
    unless table_exists?(:easy_entity_assignments)
      create_table :easy_entity_assignments do |t|
        t.references :entity_from, :polymorphic => true
        t.references :entity_to, :polymorphic => true
        t.timestamps
      end

      add_index :easy_entity_assignments, [:entity_from_type, :entity_from_id, :entity_to_type, :entity_to_id], :name => 'entity_assignment_idx', :unique => true
      add_index :easy_entity_assignments, :entity_from_id, :name => 'entity_assignment_idx_from'
      add_index :easy_entity_assignments, :entity_to_id, :name => 'entity_assignment_idx_to'
    end
  end

  def self.down
    drop_table :easy_entity_assignments
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
redmine_extensions-1.2.0 db/migrate/20160519161300_create_entity_assignments.rb
redmine_extensions-1.1.2 db/migrate/20160519161300_create_entity_assignments.rb
redmine_extensions-1.1.1 db/migrate/20160519161300_create_entity_assignments.rb
redmine_extensions-1.1.0 db/migrate/20160519161300_create_entity_assignments.rb
redmine_extensions-1.0.0 db/migrate/20160519161300_create_entity_assignments.rb
redmine_extensions-0.6.3 db/migrate/20160519161300_create_entity_assignments.rb
redmine_extensions-0.6.2 db/migrate/20160519161300_create_entity_assignments.rb
redmine_extensions-0.6.1 db/migrate/20160519161300_create_entity_assignments.rb
redmine_extensions-0.6.0 db/migrate/20160519161300_create_entity_assignments.rb