Sha256: cf1f729b91ca9196c7da4ea8409678b43f5086b8af4c91c0c701407e4bfc2d88

Contents?: true

Size: 1.09 KB

Versions: 140

Compression:

Stored size: 1.09 KB

Contents

class AddTargeting < ActiveRecord::Migration[4.2]
  def change
    create_table :targetings do |t|
      t.string :search_query, :limit => 255
      t.references :bookmark
      t.references :user
      t.string :targeting_type, :null => false, :limit => 255
      t.timestamps :null => true
    end

    add_index :targetings, [:bookmark_id], :name => 'targetings_bookmark_id'
    add_index :targetings, [:user_id], :name => 'targetings_user_id'
    add_foreign_key :targetings, :bookmarks, :name => 'targetings_bookmark_id', :column => 'bookmark_id'
    add_foreign_key :targetings, :users, :name => 'targetings_user_id', :column => 'user_id'

    create_table :targeting_hosts do |t|
      t.references :host, :null => false
      t.references :targeting, :null => false
    end

    add_index :targeting_hosts, [:host_id, :targeting_id], :name => 'targeting_hosts_host_targeting_ids'
    add_foreign_key :targeting_hosts, :hosts, :name => 'targeting_hosts_host_id', :column => 'host_id'
    add_foreign_key :targeting_hosts, :targetings, :name => 'targeting_hosts_targeting_id', :column => 'targeting_id'
  end
end

Version data entries

140 entries across 140 versions & 1 rubygems

Version Path
foreman_remote_execution-10.1.2 db/migrate/20150708133241_add_targeting.rb
foreman_remote_execution-12.0.0 db/migrate/20150708133241_add_targeting.rb
foreman_remote_execution-10.1.1 db/migrate/20150708133241_add_targeting.rb
foreman_remote_execution-11.1.1 db/migrate/20150708133241_add_targeting.rb
foreman_remote_execution-11.1.0 db/migrate/20150708133241_add_targeting.rb
foreman_remote_execution-10.1.0 db/migrate/20150708133241_add_targeting.rb
foreman_remote_execution-8.3.3 db/migrate/20150708133241_add_targeting.rb
foreman_remote_execution-8.3.2 db/migrate/20150708133241_add_targeting.rb
foreman_remote_execution-11.0.0 db/migrate/20150708133241_add_targeting.rb
foreman_remote_execution-10.0.7 db/migrate/20150708133241_add_targeting.rb
foreman_remote_execution-8.3.1 db/migrate/20150708133241_add_targeting.rb
foreman_remote_execution-10.0.6 db/migrate/20150708133241_add_targeting.rb
foreman_remote_execution-10.0.5 db/migrate/20150708133241_add_targeting.rb
foreman_remote_execution-10.0.4 db/migrate/20150708133241_add_targeting.rb
foreman_remote_execution-10.0.3 db/migrate/20150708133241_add_targeting.rb
foreman_remote_execution-10.0.2 db/migrate/20150708133241_add_targeting.rb
foreman_remote_execution-10.0.1 db/migrate/20150708133241_add_targeting.rb
foreman_remote_execution-10.0.0 db/migrate/20150708133241_add_targeting.rb
foreman_remote_execution-8.3.0 db/migrate/20150708133241_add_targeting.rb
foreman_remote_execution-9.1.0 db/migrate/20150708133241_add_targeting.rb