Defining SubSonic 3 ActiveRecord migrations

人盡茶涼 提交于 2019-12-04 19:52:56

You can still use SubSonic 3 as a DAL and let SubSonic 2.2 generate the migrations for you. You just need sonic.exe and it's dependencies to execute the migration files.

To be more precise, I have folder Migrations in my DataLayer Project, that keeps all the migration Files but set the BuildAction to none. So I have Syntax Highlighting (but no error checking unless I set BuildAction back to compile) but the code does not mess my project.

You can keep them in an own project, of course. But I like it this way to have it under version control and be sure that my current DAL is matching my migration version.

In addition, I have named my config file migration.config (instead of app.config/web.config) and use this commandline to execute my migrations.

Command:           /path/to/sonic.exe  
Arguments:         migrate /config migration.config
Working Directory: $(SolutionDir)MyProject.Datalayer

Notice the /config switch to override the config file sonic.exe is looking for.

You could have a look at SimpleRepository:

http://subsonicproject.com/docs/Simple_Repo_5_Minute_Demo

The document you linked to does state:

"Bottom line: if you're a developer that is concerned about database design, migrations might not be for you"

I suspect that for the detail of design you want (and I would too), the migrations may not be suitable?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!