I’m reading the book “Pro Active Record” by Marshall, Pytel, & Yurek.
Currently stuck on chapter 3. I’m using [Ruby 1.8.6 <2007-09-24>
patchlevel 111] & [Rails 2.1.1].
Chapter 3 discusses migrations. In the example provided in the book,
the test scripts are created and ran outside of a Rails project. The
instructions say to create a database.yml file, migrate.rb script, &
database migration script. When ‘ruby migrate.rb’ is ran from ms-dos,
it should create the schema table in my database and also create the
cows table described in the migration script.
Here’s my issue, only the ‘schema_migrations’ table is created in the
database. The cows table described in the migration isn’t created in
Please review the source below and let me know if you see anything out
of place. If you have time, try running the scripts yourself to see if
you have better results.
development: # developer’s workstation
if ARGV =~ /VERSION=\d+/
version = ARGV.split(’=’).to_i
version = nil
@logger = Logger.new $stderr
ActiveRecord::Base.logger = @logger
ActiveRecord::Base.colorize_logging = false
@config = YAML.load_file(File.join(File.dirname(FILE),
class CreateCows < ActiveRecord::Migration
create_table :cows do |t|
t.column :name, :string
t.column :breed, :string
t.column :born_on, :datetime
t.column :milkable, :boolean