So, I have this migration line:
add_column :users, :account_id, :integer
which gives the error:
SQLite3::SQLException: no such table: symbols: ALTER TABLE "symbols" ADD "account_id" integer
But when I do
add_column "users", "account_id", "integer" #changed everything to strings
I get i similar error
SQLite3::SQLException: duplicate column name: account_id: ALTER TABLE "strings" ADD "account_id" integer
NOTE:
• it doesn't matter whether or not I use add_column's parenthesis ( add_column(args) ). • no where in any of my migrations to I ever mention any tables that could be named "strings" or "symbols"So, it appears that whatever the object type of the table I'm trying to modify is, it mistakingly thinks that I want to modify a table named after that object type. =\
According to http://api.rubyonrails.org/classes/ActiveRecord/Migration.html my syntax is correct.
These migrations work on another machine, so it IS an environment issue.
I'm using Mac OS X lion.
Ruby 1.8.7 Rails 2.3.8 Rake开发者_Go百科 0.8.7EDIT (as requested): The Migration: http://pastebin.com/xhwP8TFy
So, because Stackoverflow has stupid rules, I have to use two different accounts.
Found out, that it was because of how I extended the "object" class. In config/initializers, I had some object methods.
And there was a conflict apparently. Though it never told my anything about it.
So... Don't extend object in that folder, I guess.
精彩评论