Auto_increment for primary key


I’m evaluating VP 6.1.
I’m working with MySQL 5.0 and can’t figure out how to set auto_increment feature for a column.
In simple case, I create an entity with a single primary key column and then I generate database. In the result ddl file there is:

create table test_table (id int not null, primary key (id)) type=InnoDB CHARACTER SET LATIN1;

I tried different values of ID Generator (in Column Specification form) but it doesn’t add auto_increment.

Any ideas how to beat this?


One annoying thing I came across is documentation. I didn’t manage to find explanation on ‘DDL clauses’ field in Entity Specification. Neither I’ve found anything about ‘Generated’ field and its values.


auto_increment problem only appears when generating Update Database script.

There is by the way even worse thing about Update Database. I’ve made Reverse Database on an existing db, then deleted a table. Or a column in a table. Or a relationship. And ran Update Database against my db. Which generated me an empty script.
So either I’m using it wrong, or there is a serious bug which makes the whole feature unreliable.


I Reversed Database and then created several tables in a diagram. Then generated Create Database script. Run it against empty database and… it failed. Now here is what I found in the script:
create index FKuser_role_714115 on user_role_context_object (role_id);
And later on
alter table user_role_context_object add index FKuser_role_714115 (role_id), add constraint FKuser_role_714115 foreign key (role_id) references role (id);

It wants to create the same index twice. Which mysql doesn’t allow saying 'Duplicate key name 'FKuser_role_714115’
And it is all over the script ;(

Hi artemave,

Thank you for your post and we are sorry for any inconveniences the reported problems may cause you. Would you mind sending me your project file so that we can reproduce the 3 problems you described? If you can’t post here, you can send to my Email at:

Thank you in advance!

Best regards,

Hi artemave,

Regarding auto increment for primary key, please set the ID Generator of the primary column to be identity or native. This will generate the primary key column as auto increment in MySQL database.

Concerning generating empty script, it is the current design that Update won’t handle deletion of tables, relationships and columns.

The final problem is due to the index name and the foreign key are the same. Are they the same after reversed from the database? Did you change them manually? If possible, please send me your project file for further investigation. Thank you.

Best regards,

Hi Jick,

Thank you for the quick answer (response time was the part of a hm… sanity check;)

  1. Thank you as well for the primary key hint. It works. Again, it’d be nice to have it stated more clearly in user documentation. Imho each and every interface field should be described. Which is certainly not about Visual Paradigm.

  2. ‘it is the current design that Update won’t handle deletion of tables, relationships and columns’ That explains a lot, but makes the whole feature, I’d say, useless. As well as dangerous, since one is never warned about such huge limitations.
    Are there any plans to implement those missing parts?

  3. I sent you project file on All you have to do is to Generate Database with Create (and Drop) Database option. And run it against MySQL database.

Best regards,
Artem A. Avetisyan.

Hi artemave,

The third is due to there are relationships share the same name with the indexes of foreign keys. Please read the attached image that illustrate the problem.

To be more specific, for MySQL, it will automatically create an index for foreign key (with the same name). Then, it will create two indexes during reverse, and regenerate database. Now, we have fixed the problem to make it not to reverse the foreign key index if the index equals to the foreign key index and if reversing from MySQL database. You can get the patch at:

Please execute it and install it by overwriting the existing installation.

But I regret to say that the problem already exist in your project. To fix, please remove those problem indexes. We are willing to help you fix it, too. If you accept, please send me your latest project for us to fix the problem for you.

Best regards,

Hi Jick,

Thank you for your help. Imho, database interaction part is not yet reliable in VP. However it is a remarkable product for it is outstanding diagramming/drawing/reporting capabilities. So I’d definitely take modeler license.

By the way, project file made in enterprise edition (evaluation copy) will be opened by modeler edition, won’t it?

Best regards,

Hello Artem,

Thank you for your reply. Project file made (and saved) in Enterprise Edition can be opened by any other editions and Visual Paradigm products (e.g. Agilian). However, please understand the limitation for each edition. For example, you may have created some BPD in the Enterprise Edition. When you open the project in Modeler Edition, you won’t see the diagrams appear, as Modeler Edition does not support drawing BPD. For a comparison between editions, please refer to:

Just a suggestion - Please consider buying maintenance. With maintenance, you will enjoy all the version upgrades and technical support within the maintenance period. Best of all, it only costs a small fraction of product price (If you buy with product, it costs product price * 0.2). For more information about what are included in the maintenance package, please visit:

How about the problem you reported earlier? Does the patch help? Actually we have spent a lot of effort on our ORM and data modeling support. Of course, we understand that we still have many rooms for improvements. :slight_smile:

Best regards,