In the assembly, I want to automatically create a sql script to create a new database. I plan to use this script, so I can create a main database that I can compare with the production database to create a migration script. I canβt use my development database because I have a setting for using SqlCE during development.
Unfortunately, I cannot find anything in the CodeFirst API to create a sql script. I am sure this is possible because the first model does this. I see that the API calls mine DbContextto initialize the database, but nothing that the script gave me to actually initialize it myself.
I also want this script to be generated in the assembly. What is the best way to achieve this? I was thinking of creating a T4 template and using Chirpy to run it in the assembly, but I am wondering if there is a simpler solution.
source
share