Well, my schema.rb says:

create_table "tags", :force => true do |t|
    t.string   "title"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "owner_id"
  end

when I run the migration, It says:

---------- Up Migration ----------
remove_index :tags, :name => :index_tags_on_creator_id rescue 
ActiveRecord::StatementInvalid
remove_index :tags, :name => :index_tags_on_user_id rescue 
ActiveRecord::StatementInvalid

remove_index :recipes, :name => :index_recipes_on_user_id rescue 
ActiveRecord::StatementInvalid
----------------------------------

---------- Down Migration --------
add_index :tags, [:owner_id], :name => 'index_tags_on_creator_id'
add_index :tags, [:owner_id], :name => 'index_tags_on_user_id'

add_index :recipes, [:creator_id], :name => 'index_recipes_on_user_id'
----------------------------------
What now: [g]enerate migration, generate and [m]igrate now or [c]ancel? m 

Migration filename:
(you can type spaces instead of '_' -- every little helps)
Filename [hobo_migration_24]: 
      exists  db/migrate
      create  db/migrate/20101207223435_hobo_migration_24.rb
(in /Users/mark/Documents/Hobo/recipes)
==  HoboMigration24: migrating ================================================
-- remove_index(:tags, {:name=>:index_tags_on_creator_id})
   -> 0.0010s
-- remove_index(:tags, {:name=>:index_tags_on_user_id})
   -> 0.0008s
-- remove_index(:recipes, {:name=>:index_recipes_on_user_id})
   -> 0.0009s
==  HoboMigration24: migrated (0.0030s) =======================================


But when I run it again, it says the same thing!  

The error remains, in any case.




On Dec 7, 2010, at 5:30 PM, kevinpfromnm wrote:

> If that gives an error, your db isn't matched with your model.  run a
> hobo_migration again.  that, or your has_many declaration for tags
> specifies a foreign key manually.
> 
> On Dec 7, 3:26 pm, Mark Sobkowicz <[email protected]> wrote:
>> On Dec 7, 2010, at 1:19 PM, kevinpfromnm wrote:
>> 
>>> And last, you probably can get check-many by passing your options list
>>> to it.
>> 
>>> <check-many options="&current_user.tags" />
>> 
>> This gives me an error:
>> 
>> SQLite3::SQLException: no such column: tags.user_id: SELECT * FROM "tags" 
>> WHERE ("tags".user_id = 2)
>> I need owner_id on the tags, but hobo does not figure this out.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Hobo Users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/hobousers?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to