如何应用 SubSonic 3“SimpleRepository”生产系统的改变
我一直在使用 SubSonic 的 SimpleRepository,它非常棒。但是,我想知道是否有一种简单的方法可以将待处理的更改应用到生产系统。
之前,我通过批处理文件使用了 SubSonic 2 的“Migrations”;当我准备好转移到生产环境时,我只需针对生产服务器运行所有待处理的迁移,然后就可以开始了。又好又简单。
SimpleRepostitory 更多地采用“在需要时运行它们”的迁移方法,但我不想在生产中保留该选项。
有没有办法获取待处理更改的列表?我知道我可以使用 SqlDiff 之类的东西,但由于我之前有一个有效的解决方案,失去它会很遗憾......
有人吗?
I've been playing with SubSonic's SimpleRepository, and it's awesome. However, I would like to know if there's an easy way to apply pending changes to a production system.
Previously, I used SubSonic 2's "Migrations" via a batch file; when I was ready to move to production, I'd just run all the pending migrations against the production server, and I'd be ready to go. Nice and simple.
The SimpleRepostitory takes more of a "run them when you need them" approach to migrations, but I don't want to leave that option on when in production.
Is there a way to get a list of pending changes? I know I could use something like SqlDiff, but since I had a working solution before, it'd be a shame to lose it...
Anyone?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用 reflector 您可以轻松了解 SimpleRepository 如何管理迁移。
我实际上并没有尝试过这段代码,但您可以简单地以与 SimpleRepository 相同的方式进行迁移:
这是 Reflector 中的方法:(遵循 MigrateFromModel 如何确定需要更改的内容的逻辑留给读者作为练习:))
If you use reflector you can easily find how SimpleRepository manages Migrations.
I haven't actually tried this code, but you could simply do the Migrations the same way the SimpleRepository does:
Here is the method in Reflector: (following the logic on how MigrateFromModel figures out what needs to change is left as an exercise for the reader :) )
您有机会将其打包并分享回项目吗? :)
我一直在使用更“穷人”的迁移解决方案,但它没有回滚或其他功能。
Any chance you can package this up and share it back to the project? :)
I've been using a much more "poor man's" migration solution but it doesn't have rollback or other features.