Toad World® Forums

Primary Key Constraint Name is missing in Create Script


#1

Hello,

I created some data model in TDM with PK constraints setup. Upon executing the create DDL script in SQLyog, I noticed “PK constraint name” is missing.

Example: Please refer the attached screen snap, In the data model there is a PK constraint name, however PK constraint name is missing in the create script. PK constraint name.pdf (103.4 KB)

Am I missing something here?

  1. Is there any option to have the PK constraint name in the create script?
  2. I have 400 plus tables, in all my 400 plus tables PK constraint name is missing. Is there any option to run a script in one go so that I can execute the script in SQLyog for all the tables.

Thanks !!
Rajesh


#2

Hi raaj,
I suppose from your document that you are use MySQL db. In MySQL DB primary key has always name “Primary”. It is possible run alter command where you use other name for pk, but in fact MySQL will ignore it and still pk call by Primary. So it is reason why we don§t generate this name for MySQL.
More details see in documentation of MySQL
https://dev.mysql.com/doc/refman/8.0/en/create-table.html
and here
https://forums.mysql.com/read.php?10,230403

regards
Daril