[jifty-devel] Upgrading Jifty Apps

Thomas Sibley trs at bestpractical.com
Thu Jul 13 02:53:54 EDT 2006


bart at bunting.net.au wrote:
> package AHSupport::Upgrade;
> 
> use base qw(Jifty::Upgrade);
> use AHSupport::Model::Shift;
> use Jifty::Upgrade qw( since rename );
> 
> since '0.5' => sub {
>   rename (table => 'AHSupport::Model::Shift', 
> 	  column => 'person', 
> 	  to => 'user'
> 	 );
> }

You should have a semicolon after the definition of the anonymous sub. 
This might be causing problems.

> jifty schema --setup
> Jifty version 0.607070 up to date.
> INFO - Generating SQL to upgrade AHSupport 0.400 database to 0.500
> WARN - Warning: Use of "CORE" without parentheses is ambiguous at (eval 257) line 1.

This warning should be able to be avoided by fully specifying the rename 
function as Jifty::Upgrade::rename.

> INFO - Upgrading through 0.5
> INFO - Running upgrade script
> WARN - DBD::Pg::st execute failed: ERROR:  syntax error at or near "user" at character 37
> WARN - Jifty::Handle=HASH(0x9af9a58) couldn't execute the query 'ALTER TABLE shifts RENAME person TO user' at /usr/local/share/perl/5.8.8/Jifty/DBI/Handle.pm line 484.
> INFO - Upgraded to version 0.500

Not sure about this SQL syntax error, but I'm not that familiar with Pg. 
  The Pg docs say it should work.

Hope that helps.

Tom


More information about the jifty-devel mailing list