开发者

Auxiliary Database Objects with Castle ActiveRecord

I know it's possible to run extra DDL scripts with NHibernate. For example triggers or indexes. This feature is NHibernate is named "Auxiliary Database Objects".

Is it possible to do s开发者_开发知识库ame thing in Castle ActiveRecord?


ActiveRecordStarter.CreateSchemaFromFile("myscript1.sql");

(from http://www.castleproject.org/activerecord/documentation/trunk/usersguide/schemagen.html)


Just like Diego said, ActiveRecordStarter.CreateSchemaFromFile is the way to do this.

If it doesn't execute anything, make sure your SQL script has its lines separated by ; (or GO). Even if you have a single line in your file, it has to end with ;

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜