Typo needs to work on their migrations...

Posted by Venerable High Pope Swanage I, Cogent Animal of Our Lady of Discord 06 February 2012 at 09:54PM

I use Typo, because I like Rails, and it's free, and the feature set is pretty nice. But often I find that migrating between major versions sucks.

I just upgraded to 6 from 5, and experienced a problem every time I tried to read an article imported from 5. The failures looked something like:

ActionView::MissingTemplate (Missing template /articles with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>[:html], :locale=>[:en, :en]} in view paths "/blog/themes/scribbish/views", ...)

After digging around a bit I found the culprit.

New Typo apparently supports multiple presentations for content, and now has a 'post_type' column in the contents table. If you write a new article in Typo 6, it will get the value 'read'. I went to my database and updated all the old contents to have post_type of read. e.g.

UPDATE contents SET post_type='read' WHERE post_type IS NULL;

After this, all my blog posts worked.