0

I am trying to use this gigantic bloated monster of a library, Identity, but I don't want to use entity framework. So I got NHibernate.AspNet.Identity!

I think I'm almost athe point of getting it to work but I can't seem to figure out how to generate the schema for the DB.

I thought it would automatically populate the DB with tables on first run. I was wrong...

Does anyone know where I can generate/find the schema for the database? Thanks!

Matthew Goulart
  • 2,873
  • 4
  • 28
  • 63
  • Put on hold as too broad? Have the closer read only the last sentence? It looks quite narrow to me instead, without a lot of distinct solutions. This is not about generating schema in general, this is about the schema required by a specific tool. – Frédéric Mar 16 '17 at 11:20

1 Answers1

2

Have you tried to use SchemaExport or SchemaUpdate (supports migration) classes from NHibernate.Tool.hbm2ddl? You may find usage example at What is schemaExport in Fluent NHibernate? and Fluent NHibernate - Create database schema only if not existing

In a nutshell the code for FluentNHibernate looks something like (and is similar for XML-based configuartion)

Fluently.Configure()
  .Database(/* configure database */)
  .Mappings(/* mappings */)
  .ExposeConfiguration(cfg => { new SchemaExport(cfg).Create(false, true); });
Community
  • 1
  • 1
SergGr
  • 23,570
  • 2
  • 30
  • 51