21 lines
513 B
Ruby
21 lines
513 B
Ruby
|
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
|
||
|
end
|
||
|
add_column :beers, :brewery_id, :integer
|
||
|
add_index :beers, :brewery_id
|
||
|
end
|
||
|
|
||
|
def self.down
|
||
|
drop_table :breweries
|
||
|
remove_column :beers, :brewery_id
|
||
|
end
|
||
|
end
|