title: Entity Framework Default DateTime Annotation Does Not Migrate
body: <p>I want to create a DateTime field so that it will have a default <code>GETDATE()</code> once it gets to the database. So I did this:</p>
  
  <pre><code> public class Specialty
   {
       [DatabaseGenerated(DatabaseGeneratedOption.Computed)]
       public DateTime? CreatedDate { get; set; }
  
       // other properties not shown for brevity.
   }
  </code></pre>
  
  <p>So I ran Add-Migration in the PM> console. It resulted in this (not all lines are shown) in the Up function:</p>
  
  <pre><code>AddColumn("dbo.Specialty", "CreatedDate", c =&gt; c.DateTime());
  </code></pre>
  
  <p>I understand that nullable of c.DateTime(...) is true by default, so I understand why it's not specified. BUT where is <code>defaultValueSql: "GETDATE()"</code>?</p>
  
  <p>I know I can put it in manually, but that seems to defeat the purpose of <code>Add-Migration</code> and makes <code>[DatabaseGenerated(DatabaseGeneratedOption.Computed)]</code> useless. I know for a fact that defaultValueSql's default is not "GETDATE()" because it doesn't show up when I look at column properties in SQL Management Studio.</p>
  
  <p>What's missing? Does the name "CreatedDate" violate an EF convention, then? Is there another library that I should have referenced besides <code>System.ComponentModel.DataAnnotations.Schema</code>?</p>