Is Configuration.GenerateSchemaUpdateScript () in NHibernate a good way to manage database schema changes

I use NHibernate mappings as the defining schema for my application during the development phase, and I use the method NHibernate.Tool.hbm2ddl.SchemaExport()to create the generated file to define the schema .

Now I looked at using the method Configuration.GenerateSchemaUpdateScript()to create database change scripts as follows:


var dialect = Dialect.GetDialect(configuration.Properties);
string[] schemaUpdateScript;
using (var conn = new SqlConnection(
        configuration.GetProperty("connection.connection_string")))
{
  conn.Open();
  schemaUpdateScript = configuration.GenerateSchemaUpdateScript(dialect, 
                            new DatabaseMetadata(conn, dialect));
}

After that, I save the script schema update to timestamp-named script -files.

Is this a good way to manage schema changes in NHibernate?

Are there any significant flaws?

+5
source share
1 answer

- . script, , , - , - , , , NHibernate , ?

0

All Articles