Book a Demo

Author Topic: generating PRIMARY KEY AUTO_INCREMENT  (Read 5933 times)

thoms005

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
generating PRIMARY KEY AUTO_INCREMENT
« on: August 19, 2003, 03:11:42 pm »
we are using 3.51 build 615...

is it possible to generate DDL with primary key set as auto increment as follows (for MySQL)

CREATE TABLE Classification (
     id INTEGER PRIMARY KEY AUTO_INCREMENT  NOT NULL,
     description TEXT
)
;

or is there another solution to get primary key's that auto increment? We tried:

CREATE TABLE Classification (
     id INTEGER AUTO_INCREMENT  NOT NULL,
     description TEXT
)
;

ALTER TABLE Classification
     ADD CONSTRAINT PK_Classification
     PRIMARY KEY (id)
;

and get these errors:

[MySQL on Minnow] ERROR 1075: Incorrect table definition; There can only be one auto column and it must be defined as a key
[MySQL on Minnow] ERROR 1068: Multiple primary key defined

Thanks

hd

  • EA Administrator
  • EA User
  • *****
  • Posts: 312
  • Karma: +0/-0
    • View Profile
Re: generating PRIMARY KEY AUTO_INCREMENT
« Reply #1 on: August 19, 2003, 11:51:36 pm »
Thanks for your comments. The first syntax is the correct one, and EA currently does not generate MySQL scripts in this format.

Generation of DDL scripts is currently under review, including generation of auto increments, triggers and stored procedures.