I tried "AddvideoToQuestions video: references"
A question has_many videos. A video belongs_to a question.
Tried to rake db:migrate
, and got the following error.
WHATSUP? I'm finally deep diving into coding in rails (my first real language), and this bug has been getting to me.
SQLite3::SQLException: near "references": syntax error: ALTER TABLE "questions" ADD "video" references/Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in `initialize'
@Marek Lipka -- tried that and tried rake db:migrate
again, but still the same error.
Below is the log:
(Apologies -- not familiar with how to present code blocks.
QLite3::SQLException: near "references": syntax error: ALTER TABLE "questions" ADD "video" references/Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in
initialize' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in
new' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:inprepare' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:134:in
execute' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/connection_adapters/sqlite_adapter.rb:278:inblock in execute' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:280:in
block in log' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activesupport-3.2.3/lib/active_support/notifications/instrumenter.rb:20:ininstrument' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:275:in
log' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/connection_adapters/sqlite_adapter.rb:278:inexecute' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:264:in
add_column' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/connection_adapters/sqlite_adapter.rb:400:inadd_column' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/migration.rb:466:in
block in method_missing' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/migration.rb:438:inblock in say_with_time' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/migration.rb:438:in
say_with_time' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/migration.rb:458:inmethod_missing' /Users/davidngo/Desktop/Coding/RoR_Practice/videxpert/db/migrate/20130809091631_add_video_to_question.rb:3:in
change' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/migration.rb:407:inblock (2 levels) in migrate' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/migration.rb:407:in
block in migrate' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:119:inwith_connection' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/migration.rb:389:in
migrate' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/migration.rb:528:inmigrate' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/migration.rb:720:in
block (2 levels) in migrate' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/migration.rb:775:incall' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/migration.rb:775:in
block in ddl_transaction' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:192:intransaction' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/transactions.rb:208:in
transaction' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/migration.rb:775:inddl_transaction' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/migration.rb:719:in
block in migrate' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/migration.rb:700:ineach' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/migration.rb:700:in
migrate' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/migration.rb:570:inup' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/migration.rb:551:in
migrate' /Users/davidngo/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.3/lib/active_record/railties/databases.rake:153:in `block (2 levels) in '