[jifty-devel] Perhaps another bug :)

bart bunting bart at bunting.net.au
Sun Mar 19 02:19:39 EST 2006


Hi yet again,

It appears that it is not possible to have a column called order.

When I try This is what I get.

The second output is from when I rename it to priority.

bart at zoo:~/jifty/BestBuds$ jifty schema --drop-database --setup
INFO - Generating SQL for application BestBuds...
INFO - Using BestBuds::Model::ProductColours
INFO - Using BestBuds::Model::User
INFO - Using Jifty::Model::Schema
INFO - Using BestBuds::Model::Information
INFO - Using BestBuds::Model::Product
INFO - Using BestBuds::Model::GalleryItem
INFO - Using BestBuds::Model::ProductCategory
INFO - Using BestBuds::Model::Category
INFO - Using BestBuds::Model::ProductSizes
WARN - DBD::SQLite::db prepare failed: near "order": syntax error(1) at dbdimp.c line 269 at /usr/local/share/perl/5.8.7/Jifty/DBI/Handle.pm line 416.

WARN - Jifty::Handle=HASH(0x93bd060) couldn't prepare the query 'CREATE TABLE categories (
  id INTEGER PRIMARY KEY NOT NULL  ,
  enabled boolean NOT NULL  ,
  name text NOT NULL  ,
  order integer NOT NULL  
)
'near "order": syntax error(1) at dbdimp.c line 269

error creating a table: Couldn't prepare the query 'CREATE TABLE categories (
  id INTEGER PRIMARY KEY NOT NULL  ,
  enabled boolean NOT NULL  ,
  name text NOT NULL  ,
  order integer NOT NULL  
)
'.near "order": syntax error(1) at dbdimp.c line 269 at /usr/local/share/perl/5.8.8/Jifty/Script/Schema.pm line 219.
bart at zoo:~/jifty/BestBuds$ jifty schema --drop-database --setup
INFO - Generating SQL for application BestBuds...
INFO - Using BestBuds::Model::ProductColours
INFO - Using BestBuds::Model::User
INFO - Using Jifty::Model::Schema
INFO - Using BestBuds::Model::Information
INFO - Using BestBuds::Model::Product
INFO - Using BestBuds::Model::GalleryItem
INFO - Using BestBuds::Model::ProductCategory
INFO - Using BestBuds::Model::Category
INFO - Using BestBuds::Model::ProductSizes
INFO - Set up version v0.0.2
bart at zoo:~/jifty/BestBuds$ 

The Schema is:


column name => 
  type is 'text',
  is distinct,
  is mandatory;

column enabled => 
  type is 'boolean',
  render_as 'checkbox',
  is mandatory;

column order => 
  type is 'integer',
  is mandatory;


Perhaps it's clashing with  a reserved word in sql when the statement
is generated? 

HTH

Bart


More information about the jifty-devel mailing list