[jifty-devel] schema upgrade packet length limited

Stanislav Sinyagin ssinyagin at yahoo.com
Thu Jan 17 03:30:04 EST 2008


(tested with Jifty releasse at CPAN and current SVN too)

a new Model package has been created, with corresponding since() method:

==========================
use strict;
use warnings;

package Toponet::Model::HardwareElement;


use Jifty::DBI::Schema;

use Toponet::Record schema {
    
    column deviceID => 
        refers_to Toponet::Model::Device,
        is indexed,
        is mandatory,
        since '0.0.6';

    column parent => 
        refers_to Toponet::Model::HardwareElement,
        is indexed,
        since '0.0.6';

    column elementDescription =>
        type is 'varchar(255)',
        is mandatory,
        since '0.0.6';
    
    column hardwareCategory =>
        type is 'varchar(45)',
        is indexed,
        is mandatory,
        since '0.0.6';

    column usagePercent =>
        type is 'int',
        is mandatory,
        default is 0,
        since '0.0.6';
};


use Toponet::Mixin::PropertyOwner;

sub since {'0.0.6'}
===============================

schema upgrade command produces an error below. It looks like MySQL server
receives only a part of the upgrade command: the command is cut at the second 
INDEX statement:

[root at lab1 Toponet]# jifty schema --setup
ERROR - Toponet::Dispatcher did not return a true value; assuming it was a dispatcher rule
WARN - Application schema version in database (0.0.4) doesn't match application schema version (0.0.6)
WARN - Automatically upgrading your database to match the current application schema at /usr/lib/perl5/site_perl/5.8.8/Jifty/Handle.pm line 174.
Jifty version 0.71129 up to date.
Jifty::Plugin::CSSQuery version 0.0.1 up to date.
Jifty::Plugin::CompressedCSSandJS version 0.0.1 up to date.
Jifty::Plugin::Halo version 0.0.1 up to date.
INFO - Generating SQL to upgrade Toponet 0.0.4 database to 0.0.6
INFO - Upgrading through 0.0.5
INFO - Running upgrade script
INFO - Upgrading through 0.0.6
WARN - DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';

CREATE  INDEX hardware_elements2 ON hardware_elements ( parent ) ;

CREATE  I' at line 10 at /usr/lib/perl5/site_perl/5.8.8/Jifty/DBI/Handle.pm line 552.
WARN - Toponet::Handle=HASH(0xaa1174c) couldn't execute the query 'CREATE TABLE hardware_elements (
  id INTEGER NOT NULL  AUTO_INCREMENT,
  deviceID integer NOT NULL  ,
  parent integer NULL  ,
  elementDescription varchar(255) NOT NULL  ,
  hardwareCategory varchar(45) NOT NULL  ,
  usagePercent int NOT NULL DEFAULT 0 ,
  PRIMARY KEY (id)
)
 ;

CREATE  INDEX hardware_elements2 ON hardware_elements ( parent ) ;

CREATE  INDEX hardware_elements3 ON hardware_elements ( hardwareCategory ) ;

CREATE  INDEX hardware_elements1 ON hardware_elements ( deviceID ) ;
' at /usr/lib/perl5/site_perl/5.8.8/Jifty/DBI/Handle.pm line 569.
error updating a table: Couldn't execute the query 'CREATE TABLE hardware_elements (
  id INTEGER NOT NULL  AUTO_INCREMENT,
  deviceID integer NOT NULL  ,
  parent integer NULL  ,
  elementDescription varchar(255) NOT NULL  ,
  hardwareCategory varchar(45) NOT NULL  ,
  usagePercent int NOT NULL DEFAULT 0 ,
  PRIMARY KEY (id)
)
 ;

CREATE  INDEX hardware_elements2 ON hardware_elements ( parent ) ;

CREATE  INDEX hardware_elements3 ON hardware_elements ( hardwareCategory ) ;

CREATE  INDEX hardware_elements1 ON hardware_elements ( deviceID ) ;
'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';

CREATE  INDEX hardware_elements2 ON hardware_elements ( parent ) ;

CREATE  I' at line 10 at /usr/lib/perl5/site_perl/5.8.8/Jifty/Script/Schema.pm line 623.
[root at lab1 Toponet]# 







More information about the jifty-devel mailing list