The initial error is a MySqlException (Table 'dbo.deviceconfigurations' doesn't exist) when trying to call CreateDatabase() on my model-instance.
This is perfectly clear when we consider the string that I'll get from CreateDatabaseScript() that is applied when using CreateDatabase() (see above).
Because there is only the constraint-definition in the script, the expected tables (in this case 'deviceconfigurations') have not been created beforehand, therefore causing this exception.
I've rechecked the Meta-information of the model and the entity-definitions for the tables are present (probably identical to model first). That's why I'm wondering if the Meta-information is wrongly presented with the new CTP4 or the script-creation in general is faulty.
ChrisD
Search found 2 matches
- Fri 23 Jul 2010 13:50
- Forum: Entity Framework support
- Topic: EF4 POCO & Devart
- Replies: 10
- Views: 5052
- Tue 20 Jul 2010 13:55
- Forum: Entity Framework support
- Topic: EF4 POCO & Devart
- Replies: 10
- Views: 5052
Hello,
I'm currently evaluating Code First (CTP 4) with POCO-classes for a project. In combination with Microsoft SQL Server, it works like a charm.
To connect to a local MySQL-server (v5.5.5 m3) I'd like to use the current dotConnect for MySQL to create the database scheme from my model. With CreateDatabaseScript(), I only get the "Creating all foreign keys" part in the DDL-script.
For example:
In general I can understand when there's not a total support for the unfinished Code First feature yet. But shouldn't the CreateDatabase-methods use the MetadataWorkspace-part of the Entity Framework to create the DDL-script?
Looking at the entries in the StoreItemCollection of the SSpace I don't see any difference between the configuration comparing code-based and model-based.
Thank you for time,
Christian
I'm currently evaluating Code First (CTP 4) with POCO-classes for a project. In combination with Microsoft SQL Server, it works like a charm.
To connect to a local MySQL-server (v5.5.5 m3) I'd like to use the current dotConnect for MySQL to create the database scheme from my model. With CreateDatabaseScript(), I only get the "Creating all foreign keys" part in the DDL-script.
For example:
Code: Select all
ALTER TABLE dbo.DeviceConfigurations
ADD CONSTRAINT FK_DeviceConfiguration_Device FOREIGN KEY (DeviceId) REFERENCES dbo.Devices (DeviceId)
ON DELETE CASCADE ON UPDATE NO ACTION;
Looking at the entries in the StoreItemCollection of the SSpace I don't see any difference between the configuration comparing code-based and model-based.
Thank you for time,
Christian