开发者

Why does this keep recreating my database?

开发者 https://www.devze.com 2023-04-10 12:02 出处:网络
I am using fluent nhibernate and have this line private static void BuidSchema(NHibernate.Cfg.Configuration config)

I am using fluent nhibernate and have this line

 private static void BuidSchema(NHibernate.Cfg.Configuration config)
    {
        new SchemaExport(config).Execute(false,true,false);
    }

now this keeps on recreating my database. Am I misunderstanding the parameters?

documentation

script
    true if the ddl should be outputted in the Console.
export
    true if the ddl should be executed against the Database.
justDrop
    true if only the ddl to drop the Database objects should be ex开发者_高级运维ecuted.
format
    true if the ddl should be nicely formatted instead of one statement per line.

I thought setting the justDrop to false would stop my db from being recreated if it exists.


If you set export to true it will drop a recreate your database.

0

精彩评论

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

关注公众号