Ticket #11 (new defect)

Opened 21 months ago

Last modified 21 months ago

using mysql with parkplace (and camping)

Reported by: awootton Owned by: awootton
Priority: major Milestone: Park Place 0.8
Component: component1 Version:
Keywords: mysql Cc:

Description

I can't see how it EVER worked. Perhaps it's due to a new release of activerecord. What I get is an sql error when creating the tables. The fix: Everywhere in the code, in parkplace, and in camping, like this:

t.column :id, :int, :null => false

change it to:

t.column :id, :primary_key, :null => false

activerecord apparently gets confused by the id and automatically adds autogenerate and stuff to the sql, but since it's an int, it also adds "(11)" to the end of the column declaration, and that's bogus.

I tested it with mysql, and with sqlite3 and it appears to work fine. -a

Change History

Changed 21 months ago by awootton

good sql:

CREATE TABLE sessions (id int(11) DEFAULT NULL auto_increment PRIMARY KEY, hashid varchar(32) DEFAULT NULL, created_at datetime DEFAULT NULL, ivars text DEFAULT NULL) ENGINE=InnoDB

bad sql:

CREATE TABLE sessions (id int(11) DEFAULT NULL auto_increment PRIMARY KEY(11), hashid varchar(32) DEFAULT NULL, created_at datetime DEFAULT NULL, ivars text DEFAULT NULL) ENGINE=InnoDB

Note: See TracTickets for help on using tickets.