title: Fluent Nhibernate Enum Mapping
body: <p>I have some problem with <code>enum</code> mapping in fluent NHibernate. I know this question has been asked many times but I couldn't find any solution that worked for me. I'm newbie in NHibernate and it looks like I may have missed something simple and stupid. Here is my code.</p>
  
  <pre><code>public class DBPublication
  {
      public virtual int pub_id { get; set; }
      public virtual PublicationStatuses status { get; set; }
      ...
  }
  
  public enum PublicationStatuses 
  {
      on_moderation,
      active,
      ...
  }
  
  
  public class DBPublicationMap : ClassMap&lt;DBPublication&gt;
  {
      public DBPublicationMap()
      {
          Table("content.publications");
          Id(x =&gt; x.pub_id).GeneratedBy.Sequence("content.pub_sq");           
          Map(x =&gt; x.status);
          ...
      }
  }
  </code></pre>
  
  <p>postgres enum type</p>
  
  <pre><code>CREATE TYPE content.enum_publication_status AS ENUM('on_moderation', 'active', ...);
  </code></pre>
  
  <p>but when I try to save, postgres throws this</p>
  
  <pre><code>column "status" is of type content.enum_publication_status but expression is of type text
  </code></pre>
  
  <p>any suggestion?</p>