This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I recently changed my plans to use SQL Server 2008 and switched to MySQL 5. Unfortunately I can't add any entities from the existing model to the database as all text fields trigger the error: "BLOB/TEXT: The column can't have a default value". I've also tried with a new model and the simplest of entities with a single text property producing the same result. This leads me to believe I'm doing something wrong / obvious to MySQL users.
|
|
|
Making the text property nullable resolves this issue, which makes me now wonder, can you achieve NOT NULL strings in MySQL? Is the mapping of System.String -> BLOB/TEXT necessary or do I have to set some artificial lower bound limit on each string property to keep NOT NULL in the VARCHAR realm? I think I've answered my question, but it's a big model, so I was hoping for a shortcut :) |
|
|
Yes, your answer is right. You will need to make the property nullable (or set a maximum length validation, but it sounds like that's not what you want). Since .NET strings can be null anyway, making the property nullable will have no effect on your model's API or logic, only on the generated SQL schema. |
|