title: Can NHibernate check if the db schema has been generated?
body: <p>So, newbie NHibernate user; trying to wrap my brain around it.</p>
  
  <p>I'm contemplating how to handle deployment, and later injection of add-ons to a web app (which may require their own persistence classes).</p>
  
  <p>I was thinking that using <code>SchemaExport</code> for the deployment would work pretty well, but I was wondering if there's a way too get NHibernate to tell me in a common, code-based way that a schema export has been done already, or not. Basically, I want to do smething like in this pseudocode:</p>
  
  <pre><code>  if(!_cfg.HasSchemaForType(typeof(MyType))
         ExportSchema(typeof(MyType));
    else
         UpdateSchema(typeof(MyType));
  </code></pre>
  
  <p>where the two functions would internally use <code>SchemaExport</code> or <code>SchemaUpdate</code>, respectively.</p>
  
  <hr>
  
  <p>EDIT:  Guys, I appreciate the answer so far, but they're missing the point a bit.  What I'm trying to set up is a way for the application to allow for the addition and removal of add-ons which may require changes to the db.  I'm not talking about versioning my own code or the like (at least, not as its primary function).  So the question is less about when I deploy the app, and more about when I add or remove a plug-in.  Has theis plugin (hence the pseudo-code type check) been deployed before?  If so, run the update.  If not, run the export.  Make sense?</p>