#---
# Excerpted from "Rails Recipes"
# We make no guarantees that this code is fit for any purpose. 
# Visit http://www.pragmaticprogrammer.com/titles/fr_rr for more book information.
#---
require 'rubygems' 
require 'active_record' 
ActiveRecord::Base.establish_connection(
  :adapter  => "mysql", 
  :host     => "localhost", 
  :username => "root", 
  :password => "", 
  :database => "web_orders"
) 

ActiveRecord::Base.logger = Logger.new(STDOUT) 
ActiveRecord::Schema.define do 
  create_table 'orders' do |t| 
    t.column :customer_id, :integer 
    t.column :product_id, :integer
    t.column :quantity, :integer
    t.column :processed, :boolean
    t.column :created_at, :datetime
  end 
end 
 
