Default data for installation
Is it poosible to add default data to my 开发者_运维技巧SchemaExport. If not what's best way to do that? I would like to have one *.sql file with creation script for "tables" and "default data", or is there a better way?
I just have a little console application which calls SchemaExport and then creates default entities and calls Session.Save()
on them.
all I have to do to is configure the connection string on that app and run it, and.. voila!
actually no .sql files needed at all, which I like.
I have created the schema then had to run another script to insert test data.
As another option you may want to look at these two data builder projects which allow you to create N number of entities which you could then persist.
- Plant
- NBuilder
精彩评论