title: Column with default date with Slick 3.1.0
body: <p>I have an <code>events</code> table with these columns</p>
  
  <pre><code> _________________________
  |___name_____|___time_____|
  |            |            |
  |____________|____________|
  </code></pre>
  
  <p>The value of time column is auto generated with the current date at creation time.</p>
  
  <p>Equivalently, I have this case class to represent a row in the table.</p>
  
  <pre><code>case class Event(name: String, time: Option[java.sql.Date] = None)
  </code></pre>
  
  <p>Now, the problem is that when I try to insert an event with</p>
  
  <pre><code>val event = Event("blah blah blah")
  events += event
  </code></pre>
  
  <p>Slick actually insert <code>('blah blah blah', null)</code> instead of just <code>('blah blah blah')</code>, and that makes the time field <code>null</code>.</p>
  
  <p>If I set a constraint on the time column to <code>NOT NULL</code>, then I would get an error for the attempt to insert <code>null</code>.</p>
  
  <p>Of course I can decompose my <code>event</code> object and perform the insert, but I wonder if there is a kind of mapping that tells Slick that this column is auto-generated, like in the case with the auto-increment id column:</p>
  
  <pre><code>def id = column[Long]("id", O.AutoInc)
  </code></pre>
  
  <h3>Update</h3>
  
  <p>So I try setting the time column as follow</p>
  
  <pre><code>def time = column[java.sql.Date]("time", O.AutoInc)
  </code></pre>
  
  <p>and it seems to work.</p>
  
  <p>The document for <code>AutoInc</code> states that it is use for <code>auto increment</code> and <code>auto generated</code> column.</p>
  
  <p>Though I am not sure if this is the correct way to do it.</p>