CapableObjects forum



AutoInc in MySql - problem has been identified

Posted By Bryan Crotaz 2011-08-24 16:21:53
Add to Favorites0
Author Message
Bryan Crotaz
 Posted 2011-08-24 16:21:53
Supreme Being

Supreme Being - (514 reputation)Supreme Being - (514 reputation)Supreme Being - (514 reputation)Supreme Being - (514 reputation)Supreme Being - (514 reputation)Supreme Being - (514 reputation)Supreme Being - (514 reputation)Supreme Being - (514 reputation)Supreme Being - (514 reputation)

Group: Forum Members
Last Active: 2012-02-14 20:45:32
Posts: 80, Visits: 206
514
When ECO generates an AutoInc column in a MySql database it uses

ALTER TABLE db.table ADD column INTEGER AUTO_INCREMENT NOT NULL;

This throws a MySql error complaining that you can't have two auto columns.

The correct syntax is:

ALTER TABLE db.table ADD column INTEGER AUTO_INCREMENT NOT NULL UNIQUE;

This solves the problem, and in combination with SaveAction = DBAssign gives you autoincrementing fields on your objects. I use this for an order Id and an invoice Id (separate from the ECO_ID).

I use the MySQL Workbench tool to apply this change, but I'd like to be able to do this within the model.

I've also reported this as a bug to support@capableobjects.com

Bryan


Bryan Crotaz
HansKarlsen
 Posted 2011-09-05 10:44:13
Supreme Being

Supreme Being - (3 007 reputation)Supreme Being - (3 007 reputation)Supreme Being - (3 007 reputation)Supreme Being - (3 007 reputation)Supreme Being - (3 007 reputation)Supreme Being - (3 007 reputation)Supreme Being - (3 007 reputation)Supreme Being - (3 007 reputation)Supreme Being - (3 007 reputation)

Group: Administrators
Last Active: Yesterday @ 18:25:39
Posts: 446, Visits: 2 654
This is now fixed like this: "ADD column INTEGER AUTO_INCREMENT UNIQUE NOT NULL"

Before we did: "ADD column INTEGER AUTO_INCREMENT NOT NULL"

RickWeyrauch
 Posted 2011-09-08 15:19:18
Supreme Being

Supreme Being - (1 663 reputation)Supreme Being - (1 663 reputation)Supreme Being - (1 663 reputation)Supreme Being - (1 663 reputation)Supreme Being - (1 663 reputation)Supreme Being - (1 663 reputation)Supreme Being - (1 663 reputation)Supreme Being - (1 663 reputation)Supreme Being - (1 663 reputation)

Group: Forum Members
Last Active: 2012-04-18 18:57:58
Posts: 249, Visits: 7 773
I am wondering if you also included the BLOB size change required to use large schemas with MySql? (http://www.capableobjects.com/apps/InstantForum414/Topic6221-4-1.aspx)

Changing the BLOB callout to MEDIUMBLOB solved my problem - but I never heard back if that was acceptable to have for all versions of MySql. I would think 16M would be large enough to handle most application binary needs.

Rick Weyrauch

HansKarlsen
 Posted 2011-09-08 23:09:47
Supreme Being

Supreme Being - (3 007 reputation)Supreme Being - (3 007 reputation)Supreme Being - (3 007 reputation)Supreme Being - (3 007 reputation)Supreme Being - (3 007 reputation)Supreme Being - (3 007 reputation)Supreme Being - (3 007 reputation)Supreme Being - (3 007 reputation)Supreme Being - (3 007 reputation)

Group: Administrators
Last Active: Yesterday @ 18:25:39
Posts: 446, Visits: 2 654
mysql changed blob to mediumblob today - so daily build tomorrow

Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Back To Top