Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Making a table auto-increment

Quote Reply
Making a table auto-increment
Hello all,

I am writing a plugin that requires a table to be added. I can create a table fine in my install script except that I can't make one with an auto increment on the primary key. I can't find documentation in the GT::SQL::Creator section saying how to do it.

Does anyone know?

Also I want to add a unique constraint to a column. It says that GT::SQL::Creator::unique takes the same args as GT::SQL::Creator::index but I can't get the unique constraint to work either.

Can anyone help me?

Thanks,

Tommy
Quote Reply
Re: [tommyfotak] Making a table auto-increment In reply to
$c->pk('ID');
$c->ai('ID');

Where $c = $creator->('table');

ai = auto increment
pk = primary key

$c->unique( { somename => ['column_name'] } );


http://www.iuni.com/...tware/web/index.html
Links Plugins

Last edited by:

Ian: Jul 9, 2002, 4:46 PM
Quote Reply
Re: [Ian] Making a table auto-increment In reply to
Thanks Ian.

I'll give that a bash.