forgot password?


   
 
Problem importing the DB Schema into MySQL
Posted: 22 February 2008 08:40 AM   [ Ignore ]  
Newbie
Rank
Total Posts:  3
Joined  2008-02-22

When trying to get import the tracks database schema into my MySQL database, I continuously get the following MySQL Syntax error (full rake output further below).

Mysql::Error#42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''contexts' SET 'user_id' = 1' at line 1: UPDATE 'contexts' SET 'user_id' = 1; 


I tried using “rake migrate” both with the rails version included tracks, and the latest version I have (2.0.2).

I was wondering whether anybody has or could create a MySQL schema dump and post it here?
Help is much appreciated! Thanks // pascal

OS X 10.5
MySQL 5.0.45

#>$ rake migrate --trace
(in tmp/tracks)
** 
Invoke migrate (first_time)
** 
Invoke environment (first_time)
** 
Execute environment
** Execute migrate
rake aborted
!
Mysql::Error#42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''contexts' SET 'user_id' = 1' at line 1: UPDATE 'contexts' SET 'user_id' = 1;
/tmp/tracks/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:88:in `log'
/tmp/tracks/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:180:in 
`execute'
/tmp/tracks/vendor/rails/activerecord/lib/active_record/migration.rb:170:in `send'
/tmp/tracks/vendor/rails/activerecord/lib/active_record/migration.rb:170:in `method_missing'
./db/migrate//2_add_user_id.rb:6:in 
`up'
/tmp/tracks/vendor/rails/activerecord/lib/active_record/migration.rb:228:in `send'
/tmp/tracks/vendor/rails/activerecord/lib/active_record/migration.rb:228:in `migrate'
/tmp/tracks/vendor/rails/activerecord/lib/active_record/migration.rb:223:in 
`each'
/tmp/tracks/vendor/rails/activerecord/lib/active_record/migration.rb:223:in `migrate'
/tmp/tracks/vendor/rails/activerecord/lib/active_record/migration.rb:190:in `up'
/tmp/tracks/vendor/rails/activerecord/lib/active_record/migration.rb:181:in 
`migrate'
/tmp/tracks/vendor/rails/railties/lib/tasks/databases.rake:3
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `call'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in 
`each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in 
`synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in `invoke'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1931:in 
`invoke_task'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in 
`top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1903:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1881:in 
`run'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1878:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/bin/rake:31
/usr/bin/rake:19:in 
`load'
/usr/bin/rake:19
#>$ 
Profile
 
 
Posted: 07 March 2008 07:56 PM   [ Ignore ]   [ # 1 ]  
Sr. Member
RankRankRankRank
Total Posts:  882
Joined  2006-10-05

what version of tracks are you using?

Profile
 
 
Posted: 08 March 2008 09:25 PM   [ Ignore ]   [ # 2 ]  
Newbie
Rank
Total Posts:  3
Joined  2008-02-22

I think I was using 1.044 (the latest at the time). But I just downloaded version 1.5, and db:migrate is working fine now. Thanks // p

Profile
 
 
Posted: 09 March 2008 10:09 AM   [ Ignore ]   [ # 3 ]  
Sr. Member
RankRankRankRank
Total Posts:  882
Joined  2006-10-05

1.043 does have some issues with ruby 1.8.6.

Profile