Forward Engineering Trouble Shooting


Forward Engineering tries to construct a database shema on the target DBMS based on the design from DbWrench. Due to implemenation and functionality variations among the DBMSs some problems can occur.

Avoid Using Reserved Words

Avoid naming entities, such as tables, columns, etc with reserved words. For example in some DBMSs, the word Image is a reserved word and using it for a table name may cause errors during forward engineering. Although DbWrench will automatically escape many reserved words in it's generated scripts, this can still be problematic in other cases.

View Not Created on Microsoft SQL Server

Ensure the Select portion of the view definition doesn't duplicate any column names. This view will not be created nor will an error be reported.

Ensure the Select portion of the view definition doesn't contain the wildcard character '*'. This view will not be created nor will an error be reported.

MySQL Applies a Different Primary Key Than Specified

If a column is specified as AUTO_INCREMENT, MySQL will automatically use this column as the primary key and ignore any other primary keys specified.

MySQL Numeric Data Types.

MySQL may use DECIMAL, NUMERIC and FIXED datatypes interchangeably.

MySQL Does Not Foreward Engineer Column Comments.

Only MySQL versions 4.1 or greater support column level comments.

MySQL Foreign Keys Generation Fails with errno 150

MySQL requires that indexes be created on all the columns used in the foreign key. This includes columns from both the child and parent table. Make sure there indexes on all columns involved in foreign keys. However, starting with v4.1.2, MySQL will automatically add these indexes.

If DbWrench determines that indexes may be required it will list which indexes are required in the Add Foreign Keys section of the Script Text in Forward Engineer window.

PostgreSQL MONEY Data Type

In PostgreSQL the data type MONEY is now deprecated and may automatically be converted to DECIMAL or NUMERIC.

PostgreSQL Foreign Key Data Types

In PostgreSQL foreign keys may not be added if the data types of the columns forming the foreign key do not match. For example a foreign key between an INTEGER and a SMALLINT column may fail.

See also:

Forward Engineering