summaryrefslogtreecommitdiffstats
path: root/db/migrate/20130602092539_create_queries_roles.rb
blob: f37c26bbfdbe1953eed9986f86a5252519aa2feb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
class CreateQueriesRoles < ActiveRecord::Migration[4.2]
  def self.up
    create_table :queries_roles, :id => false do |t|
      t.column :query_id, :integer, :null => false
      t.column :role_id, :integer, :null => false
    end
    add_index :queries_roles, [:query_id, :role_id], :unique => true, :name => :queries_roles_ids
  end

  def self.down
    drop_table :queries_roles
  end
end