dotConnect for PostgreSQL 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 PgSqlEntityProviderConfig.DatabaseScript.Schema and PgSqlEntityProviderConfig.DatabaseScript.ForeignKey classes.
DeleteDatabaseBehaviour. This enumeration determines the behavior of the DeleteDatabase() function.
Schema - entire schema, containing model objects, is created/deleted. If the model contains objects from other schemas, these schemas will be created/deleted as well.
Note that if there are model objects, mapped to database objects in other schemas, these schemas are created/deleted only when using the following database initialization strategies: CreateDatabaseIfNotExists, DropCreateDatabaseIfModelChanges, DropCreateDatabaseAlways or when explicitly using the CreateDatabase()/DeleteDatabase() methods of the ObjectContext class or the Database class that is used with DbContext instead of using a database initialization strategy. If you use the MigrateDatabaseToLatestVersion database initialization strategy, you need to generate a code-based migration and add SQL commands for creating/deleting necessary schemas using the Sql() method of the DbMigration class.
If several schemas are specified in the Schema connection string parameter, all of these schemas are created/deleted.