How to update schema in SQL Server database using Active Records and nhibernate?

325 Views Asked by At

I have winforms application which uses nhibernate and active records to access the database. My question is how do I update the database schema through the application? The CreateSchema method deletes the database and creates a new one. Is there anyway to update just few parts of the database through some method.

1

There are 1 best solutions below

0
On BEST ANSWER

You can use schemaupdate, providing you have the configuration

 public void CanUpdateDatabase()
    {
        SchemaUpdate su = new SchemaUpdate(config);
        su.Execute(true, true);
    }

it works depending on the db dialect ( in my experience works well with MSSQL+Oracle )