Class: GTFS::Meta::CreateFeedVersions

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/gtfs/meta/migrations/create_feed_versions.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_feed_versions.rb', line 6

def change
  create_table :feed_versions do |t|
    t.integer :feed_id, :null => false
    t.string :etag, :null => false
    t.datetime :last_modified_at, :null => false
    t.text :file_names
    t.timestamps
  end

  add_index :feed_versions, :feed_id
  add_index :feed_versions, [:feed_id, :etag, :last_modified_at], :unique => true, :name => "version_composite_key"
end