开发者

Auxiliary Database Objects with Castle ActiveRecord

开发者 https://www.devze.com 2023-01-19 15:04 出处:网络
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\".

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

精彩评论

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