Technology Insights

Adding Redmine Project Error: ActiveRecord::StatementInvalid (Mysql::Error: Unknown column projects_count in field list

I was working on a project today for a client and after the initial research I realized that the project actually warranted an entire sub project account in Redmine. The reasoning behind this was even though the project would be using the same Ruby project code as the primary project this specific side project would need to allow access to the tickets for one of our partners. The easiest way to allow the partners accounts access to only a specific set of tickets, their own wiki, etc. would be to generate a sub Redmine project underneath of the primary Redmine project. So obviously the first thing to do was to add the project so I could start configuring it and this is where I ran into the initial issue. I received an internal server error when attempting to add the sub project within Redmine. Below I describe the issue, what I think caused the issue, and the end resolution that allowed me to start adding sub projects within Redmine again.

Technology Insights

ActiveRecord SQL in script/console

Rails’ ActiveRecord displays the exact SQL queries it performs into the development log. It is inconvenient to watch this log while you’re working in the `script/console` environment, however, and most advice for redirecting that log to STDOUT seemed not to work. Thanks to [Jamis Buck](http://weblog.jamisbuck.org/2007/1/31/more-on-watching-activerecord “More on watching ActiveRecord”), though, the solution has come to light:

Technology Insights

Rants About Rails Database Migrations

Migrations as version control for databases

When I first learned about Rails migration, I immediately thought that dropping down a revision would be something you would do often. In actuality, Rails migrations is more like a version control for databases. Since databases changes require modifications to both code and data, you cannot simply use a source code version control system like Subversion or Sourcesafe. You need a more advanced revisioning system for databases… hence Rails Migrations.