Forum: Ruby on Rails db:migrate non-functional?

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.
George G. (Guest)
on 2007-02-06 09:43
Am new to rails, but catching up fast.
i have developed my model

.....generate model people

---------------------------
class CreatePeoples < ActiveRecord::Migration
  def self.up
    create_table :peoples do |t|
    t.column :name, :string
    t.column :hashed_password, :string
    t.column :salt, :string
    end
  end

  def self.down
    drop_table :peoples
  end
end
------------------------------------------

blah blah.... rake db:migrate

all life signals confirmed to be ok
no errors generated by rake command


but ooops when i check  the database .... no table was actually created
despite
running a successful rake


schema.rb seems to record a table creation but actually no table was
created when i check in the database.

can somebody help in explaining?
thanks
toby privett (Guest)
on 2007-02-06 10:51
(Received via mailing list)
If you previously ran this migration and it failed, the schema version
might be set to the migration that you are running. i.e. This
migration is being ignored.

Try:
rake db:migrate VERSION=X
where X is a previous migration.

To roll the whole thing back:
rake db:migrate VERSION=0

Or if you're using sqlite3, simply delete the file and run the
migrations again

hth

>     create_table :peoples do |t|
On a different note ActiveRecord would probably be happier with a
singular "Person" and plural "People"
George G. (Guest)
on 2007-02-06 11:16
toby privett wrote:
> If you previously ran this migration and it failed, the schema version
> might be set to the migration that you are running. i.e. This
> migration is being ignored.
>
> Try:
> rake db:migrate VERSION=X
> where X is a previous migration.
>
> To roll the whole thing back:
> rake db:migrate VERSION=0
>
> Or if you're using sqlite3, simply delete the file and run the
> migrations again
>
> hth
>
>>     create_table :peoples do |t|
> On a different note ActiveRecord would probably be happier with a
> singular "Person" and plural "People"

it has worked!
, thanks  a lot and i love this forum!
This topic is locked and can not be replied to.