Welcome Guest Login Register Member List
ExpressionEngine Forums
Advanced Search
Username: Password:
Remember Me? forgot password?
You are here: Forum Home  >  Usage  >  Troubleshooting  >  Thread
   
 
Starting with Trunk and MySQL (was SQLite3)
 
Gobo
Posted: 17 January 2007 10:40 AM   [ Ignore ]  
Newbie
Rank
Total Posts:  6
Joined  2006-09-01

I’m curious about the new version and I’d like to check out all the new features smile

So I checked out the trunk version of tracks, but I’m having a bit of trouble getting my sqlite3 database to work properly. Here’s what I did:

% svn co http://www.rousette.org.uk/svn/tracks-repos/trunk/tracks
% cp -r log.tmpl log
% cp config/environment.rb.tmpl config/environment.rb
% cp config/database.yml.tmpl config/database.yml
% cp db/tracks-1041.db ~/Documents/tracks.db 

I then set all the necessary Tracks knobs and dials to the right setting (db type and path in database.yml and salt in environment.rb)
According to the documentation, I then have to run “rake migrate”, however, that fails:

== ConvertPreferences: migrating ==============================================
-- 
remove_column(:users, :preferences)
rake aborted!
SQL logic error or missing database 

If that means it is trying to remove a column from the table, then I know what’s wrong: SQLite3 does not support dropping of columns…
Is there another way of getting this to setup properly?

Profile
 
lukemelia
Posted: 17 January 2007 01:28 PM   [ Ignore ]   [ # 1 ]  
Member
Avatar
RankRankRank
Total Posts:  62
Joined  2006-07-18

In db/schema.rb is a file that represents the current database schema in ruby. You should be able to create a sql-lite-3 database with that somehow. We’ll get a smooth path in place for the next release, but as of now, I think bsag and I are mostly doing day-to-day development against mysql.

Signature 

Luke Melia - Tracks committer - New York, NY - http://www.lukemelia.com/

Profile
 
Gobo
Posted: 17 January 2007 03:38 PM   [ Ignore ]   [ # 2 ]  
Newbie
Rank
Total Posts:  6
Joined  2006-09-01

I’ve switched to MySQL and have had a little more luck.

However, the rake migrate task still has problems.
This time it seems to hiccup on adding the indexes to the tables. It seems to fail because the todos table does not have a state column.
I added that manually, but it still seemed to have problems, so in the end I just added the state column by myself.

Also the state column in the projects table was not added and the completed in todos was not renamed to completed_at.

I’m not very familiar with the rake migrate task, I guessed it would run all the scripts in db/migrate/. If that is the case, then there seems to be a mismatch with what is happening there and the schema in db/schema.rb

Profile
 
lukemelia
Posted: 17 January 2007 07:05 PM   [ Ignore ]   [ # 3 ]  
Member
Avatar
RankRankRank
Total Posts:  62
Joined  2006-07-18

Basically, what rake migrate does is check the current version of the database by looking for a table called (I think) schema_version. It then runs all migrations greater than that number in order. The state column should have been added to the projects table in 014 and to the todo table in 019.

Anyway, I’m glad you were able to muddle through and look forward to your feedback!

Signature 

Luke Melia - Tracks committer - New York, NY - http://www.lukemelia.com/

Profile
 
Gobo
Posted: 17 January 2007 07:37 PM   [ Ignore ]   [ # 4 ]  
Newbie
Rank
Total Posts:  6
Joined  2006-09-01

Hmm, this whole procedure may need to have some more looking into.

IMHO it might make more sense to try the proper SQL to update to the present schema, and then look at what kind of errors you get back. That, or be a little bit more conservative with updating the version number…

Where is the code that handles the “rake migrate” task by the way?

Profile
 
lukemelia
Posted: 17 January 2007 08:17 PM   [ Ignore ]   [ # 5 ]  
Member
Avatar
RankRankRank
Total Posts:  62
Joined  2006-07-18
Gobo - 17 January 2007 07:37 PM

Hmm, this whole procedure may need to have some more looking into.

Feel free. It’s important to get a good upgrade process in place before the next release.

Gobo - 17 January 2007 07:37 PM

IMHO it might make more sense to try the proper SQL to update to the present schema, and then look at what kind of errors you get back. That, or be a little bit more conservative with updating the version number…

Where is the code that handles the “rake migrate” task by the way?

ActiveRecord migrations are a feature of Ruby on Rails and are within the codebase in vendor/rails. You should read up on them to get an understanding of how they work and how they’re designed to be used in the development of Rails apps.

Cheers,
Luke

Signature 

Luke Melia - Tracks committer - New York, NY - http://www.lukemelia.com/

Profile
 
Eric
Posted: 29 January 2007 04:23 PM   [ Ignore ]   [ # 6 ]  
Newbie
Rank
Total Posts:  1
Joined  2007-01-29

I just tried using the trunk (revision 410) with a fresh start.  The migration from an empty database worked nicely.  However, I couldn’t use the software.  The login controller, recognizing that this is a fresh install, redirects to the signup action.  But there is no signup action in the login controller, and ultimately an error is generated/logged about not finding a view login/index.rhtml.

Profile
 
lukemelia
Posted: 29 January 2007 07:19 PM   [ Ignore ]   [ # 7 ]  
Member
Avatar
RankRankRank
Total Posts:  62
Joined  2006-07-18

Hi Eric,

I changed a lot of code in there recently. What you describe is likely a bug introduced there. Please open a ticket or submit a patch on the Trac and hopefully I can fix this in the next couple of days.

Cheers,
Luke

Signature 

Luke Melia - Tracks committer - New York, NY - http://www.lukemelia.com/

Profile
 
lukemelia
Posted: 30 January 2007 06:00 AM   [ Ignore ]   [ # 8 ]  
Member
Avatar
RankRankRank
Total Posts:  62
Joined  2006-07-18

FYI. The problem is fixed in revision 411.

Signature 

Luke Melia - Tracks committer - New York, NY - http://www.lukemelia.com/

Profile
 
   
 
 
‹‹ running TRUNK migrate on existing 1.043 db fails      Speed - Apache vs Locomotive ››

Powered By ExpressionEngine
Template Design By Sonnenvogel.com
Select a theme:

ExpressionEngine Discussion Forum - Version 2.1.1 (20081028)
Script Executed in 0.1678 seconds

Atom Feed
RSS 2.0