Class: GTFS::Meta::CreateFeeds

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/gtfs/meta/migrations/create_feeds.rb

Instance Method Summary collapse

Instance Method Details

#changeObject

TODO: re-construct this migration from a custom generator



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/gtfs/meta/migrations/create_feeds.rb', line 6

def change
  create_table :feeds do |t|
    t.integer :publisher_id, :null => false
    t.string :source_url, :null => false
    t.string :source_title, :null => false
    t.timestamps
  end

  add_index :feeds, :publisher_id
  add_index :feeds, :source_url, :unique => true
  add_index :feeds, [:publisher_id, :source_title], :unique => true, :name => "publisher_unique_source_titles"
end