It's usually not appropriate for your application to recreate database tables each time it runs. In this recipe, we'll generate a SQL script to create your database objects.
This recipe works for any RDBMS supported by NHibernate. To use a different system, adjust your connection string and dialect accordingly.
using NHibernate.Tool.hbm2ddl;to the beginning of the file.
var schemaExport = new SchemaExport(nhConfig); ...