Forum: Ruby on Rails Rake Migrations for Rails 1.1

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0e3dc7e71633fb1a06eba99e99cdb41f?d=identicon&s=25 Robert (Guest)
on 2006-03-29 22:20
Hi all. I keep having the following error when I invoke the rake
db:migrate command for Rails 1.1 (Ruby 1.8.2 -- Windows 2000)

** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
== Realtorex: migrating
=======================================================
-- create()
rake aborted!
undefined method `create' for
#<ActiveRecord::ConnectionAdapters::MysqlAdapter:0x3472828>
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:271:in
`send'
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:271:in
`method_missing'
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:269:in
`say_with_time'
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:255:in
`measure'
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:255:in
`say_with_time'
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:269:in
`method_missing'
./db/migrate//001_realtorex.rb:3:in `real_up'
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:209:in
`send'
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:209:in
`migrate'
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:209:in
`measure'
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:209:in
`migrate'
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:331:in
`migrate'
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:326:in
`each'
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:326:in
`migrate'
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:293:in
`up'
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:284:in
`migrate'
d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/tasks/databases.rake:4
d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/tasks/databases.rake:3:in
`call'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:232:in `execute'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:232:in `each'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:232:in `execute'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:202:in `invoke'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:195:in
`synchronize'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:195:in `invoke'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:1719:in `run'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:1719:in `each'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:1719:in `run'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/bin/rake:7
d:/ruby/bin/rake:18:in `load'

-----------------------------------------
My migration file is the following:

class Realtorex < ActiveRecord::Migration
  def self.up
	create.table "pages", :force => true do |t|
		t.column "id",				:integer
		t.column "name",			:string
		t.column "title",			:string
		t.column "body",			:text
		t.column "body_html",		:text
		t.column "user_id",			:integer
		t.column "updated_at",		:datetime
		t.column "created_at",		:datetime
	end

	create.table "users", :force => true do |t|
		t.column "id",				:integer
		t.column "login",			:string
		t.column "name",			:string
		t.column "hashed_password",	:string
		t.column "email",			:string
	end

	create.table "products", :force => true do |t|
		t.column "id",				:integer
		t.column "title",			:string
		t.column "description",		:text
		t.column "price",			:decimal
		t.column "availability",	:datetime
	end

	create.table "line_items", :force => true do |t|
		t.column "id",				:integer
		t.column "product_id",		:integer
		t.column "order_id",		:integer
		t.column "quantity",		:integer
		t.column "price",			:decimal
	end

	create.table "orders", :force => true do |t|
		t.column "id", 				:integer
		t.column "name",			:string
		t.column "email",			:string
		t.column "address",			:string
		t.column "city",			:string
		t.column "state",			:string
		t.column "zipcode",			:string
		t.column "pay_type",		:decimal
		t.column "fulfilled_at",	:datetime
	end
  end

  def self.down
	 drop_table :pages
	 drop_table :users
	 drop_table :line_items
	 drop_table :orders
  end
end


Any clues?
B26c571d17b3022ab1a98c1a223c32e6?d=identicon&s=25 David Thomson (Guest)
on 2006-03-29 23:00
(Received via mailing list)
You should call create_table rather than create.table, I think.

David
0e3dc7e71633fb1a06eba99e99cdb41f?d=identicon&s=25 Robert Evans (revans)
on 2006-03-29 23:20
David Thomson wrote:
> You should call create_table rather than create.table, I think.
>
> David

haha, you're right. I can't believe I missed that, silly me. Thanks
David!
This topic is locked and can not be replied to.