using System; using System.Collections.Generic; using System.Linq; using System.Text; using GeneralApi.Core.Infrastructure; using GeneralApi.Core.Infrastructure.DataAccess; using NHibernate.Tool.hbm2ddl; namespace GeneralApi.CreateDb { class Program { static void Main(string[] args) { createDbSchema(); } private static void createDbSchema() { var configuration = NHConfiguration.Configure(); var exporter = new SchemaExport(configuration); //dropAllTables(configuration); exporter.Execute(true, true, false); // nhibernate (and as result fluent nhibernate) can't specify names for the // primary keys. So in order to have the same sql scripts for databases // which are created based on the same source code - we need to specify them explicitly // try // { // it may throw exception "Either the parameter @objname is ambiguous..." // It is not crucial as all code is already executed // renameConstraints(configuration); // } // catch // { // } } } }