title: Fluent NHibernate: SchemaExport and SchemaUpdate
body: <p>I need help with a problem in my application.</p>
  
  <p>I've created a project in Visual Studio, and I've installed and configured Fluent NHibernate. I was able to configure everything correctly, and I was able to connect to my database.</p>
  
  <p>I tried to insert a few rows into my table, and everything was okay, but whenever I restarted my application, I noticed that the tables were being dropped and re-created, and all the data were gone.</p>
  
  <p>I solved this problem by using:</p>
  
  <pre><code>.ExposeConfiguration(cfg =&gt; new SchemaUpdate(cfg).Execute(true, true))
  </code></pre>
  
  <p>instead of:</p>
  
  <pre><code>.ExposeConfiguration(cfg =&gt; new SchemaExport(cfg).Create(true, true))
  </code></pre>
  
  <p>Everything so far is okay, but now here's the problem. Let's say I have a class Person.cs with two fields: <strong>Id, Name.</strong> And let's say I wanted to add a new property called <strong>Address</strong>. I add the property to my class and run my application. I try to add a few rows and check the database to see that indeed, a new column called Address was created and <em>null</em> values were inserted for old entries.</p>
  
  <p>Now let's say I changed my mind and decided to remove the new property Address. I remove the property from my Person.cs class and run the application. I insert a few entries and check the database to see that the column Address was not removed and is still there in the table.</p>
  
  <p>Why is this happening exactly? Shouldn't the mapping configuration do everything for me? I expect the no-longer needed columns to be dropped in the database the same way they are created when I add new properties to my class and without losing my data. What should I do?</p>