I managed how to set default values, for example table type for MySQL.
Default value is ‘Default’. This is wrong staring point but I will talk about it later.
Let’s do scenario:
- open new MySQL 5.1 model
- Make sure that default entity type is ‘Default’
- Create first entity
- Check entity type of created entity - should be ‘Default’
- Change Default value of entity type to InnoDB
- Create second entity
- Check entity type of created entity - will be ‘Default’ again
Question is: why ?
I’ve checked scenario in which def. type of entity is changed before creating the first entity. In that case, after creating entity the table type is set correct to InnoDB.
Using default values set to ‘default’ may be helpful in some cases. But:
starting with these values you will never sure how DB will react on it. For example, on developer server, InnoDB is set as default and all relations and transactions will work as expected. But on production server there will be MyIsam set as default which will cause serious damage in data.
Letting values to be default causes generating alter scripts feature simply useless. For example, ‘Default’ setting in model will be compared to real table type in database raising notification about differences.
Message was edited by: Michal.K