Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想通过代码触发数据库迁移到最新版本。
我已经配置了迁移并且它们工作正常,但我可以让它们迁移的唯一方法是查询我认为不需要的数据库。
我确信我刚刚错过了文档中的某些内容来触发迁移,但如果有人能指出我正确的方向,我将不胜感激。
我发现一篇相关文章回答了这个问题,我需要做的就是调用Database.Initialize(false);我的例程来升级数据库。
Database.Initialize(false);
实体框架 4.3 在应用程序启动时运行迁移