Database Script Generation Settings
In This Topic
dotConnect for DB2 allows configuring creating and deleting database objects in the CreateDatabase() and DeleteDatabase() methods. These customizations are rather useful for the Code First approach. You can tweak the behaviour of the methods using the DB2EntityProviderConfig.DatabaseScript.Schema, DB2EntityProviderConfig.DatabaseScript.Table,
and DB2EntityProviderConfig.DatabaseScript.ForeignKey classes.
DB2EntityProviderConfig.DatabaseScript.Schema Settings
DeleteDatabaseBehaviour. This enumeration determines the behavior of the DeleteDatabase() function.
- ModelObjectsOnly - this is the default value. Only the tables that model objects are mapped to are created/deleted.
- AllSchemaObjects - all tables will be created/deleted from schemas or databases that model objects were mapped to.
DB2EntityProviderConfig.DatabaseScript.ForeignKey Settings
- Enabled. Turns on/off generation of foreign constraints. The default value is true.
- IndexCreation. When set to true, an index is created for the columns being parts of the foreign key. The default value is true.
DB2EntityProviderConfig.DatabaseScript.Table Settings
- TableTablespace - set the name of the tablespace for the created tables.
- IndexTablespace - set the name of the tablespace for the created indexes.
- LongTablespace - set the name of the tablespace for the long columns. They include the columns with LOB data types, XML type, distinct types with any of these as source types, or any columns defined with user-defined structured types whose values cannot be stored inline.
DB2EntityProviderConfig.DatabaseScript.Column Settings