Sha256: 0002efcd7b983fde1d61cd20531bcc375c8aa6082ea911368f36b051cd976bd8
Contents?: true
Size: 1.07 KB
Versions: 11
Compression:
Stored size: 1.07 KB
Contents
class AddTargeting < ActiveRecord::Migration 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 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
11 entries across 11 versions & 1 rubygems