This repository has been archived on 2020-05-27. You can view files and clone it, but cannot push or open issues/pull-requests.
2007-11-15 00:35:29 -05:00
|
|
|
class CreateBreweries < ActiveRecord::Migration
|
|
|
|
def self.up
|
|
|
|
create_table :breweries do |t|
|
|
|
|
t.column :title, :string
|
|
|
|
t.column :address_1, :string
|
|
|
|
t.column :address_2, :string
|
|
|
|
t.column :city, :string
|
|
|
|
t.column :state, :string
|
|
|
|
t.column :postal_code, :string
|
|
|
|
t.column :country, :string
|
2008-02-03 04:27:09 -05:00
|
|
|
t.column :homepage, :string
|
2008-02-03 00:50:41 -05:00
|
|
|
t.column :created_at, :timestamp
|
2007-11-15 00:35:29 -05:00
|
|
|
end
|
|
|
|
add_column :beers, :brewery_id, :integer
|
|
|
|
add_index :beers, :brewery_id
|
2008-02-03 00:50:41 -05:00
|
|
|
add_index :breweries, :title
|
2007-11-15 00:35:29 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.down
|
|
|
|
drop_table :breweries
|
|
|
|
remove_column :beers, :brewery_id
|
|
|
|
end
|
|
|
|
end
|