This repository has been archived on 2020-05-27. You can view files and clone it, but cannot push or open issues/pull-requests.
barleysodas/db/migrate/004_create_breweries.rb

21 lines
513 B
Ruby
Raw Normal View History

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