Closed alecdesjardins closed 2 months ago
Once you are have converted to a physical model of Postgresql, you are able to use bigserial
, serial
, smallserial
.
Although, it is not efficient to go through each table and manually convert the auto incrementing primary keys.
Please install this beta: https://dbschema.com/beta.php also drop the .DbSchema folder from the user home directory, and restart DbSchema.
I tried to reproduce the issue using the attached model file ( please rename it to .dbs ). If the issue persists, it helps to use the same model to reproduce the issue. Logical4Pg.txt
Environment
Description
When converting a logical model to a physical model or exporting a schema in DbSchema, the tool does not correctly convert integer or biginteger fields that should auto-increment for PostgreSQL databases. It incorrectly uses
AUTO_INCREMENT
, which is not supported by PostgreSQL. Instead, PostgreSQL usesSERIAL
orBIGSERIAL
(other methods too). This issue manifests when exporting a schema model designed specifically for PostgreSQL, resulting in syntax errors if the script is executed in a PostgreSQL environment.Additionally, there is a minor formatting error in the generated SQL script where an extra space is inserted between 'CREATE' and 'TABLE'.
Steps to Reproduce
Current Behavior
The generated script incorrectly uses
AUTO_INCREMENT
, and there is an unnecessary space between 'CREATE' and 'TABLE':