title: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column cannot be null
body: <p>When I want to create new user via terminal I got this error :</p>
  
  <pre><code>Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 
  1048 Column 'created_at' cannot be null
  </code></pre>
  
  <p>I am using MySQL database and Doctrine 2.5 as ORM. 
  Here is setting of the table:</p>
  
  <pre><code>Column  Type    Comment
  id  int(11) Auto Increment   
  name    varchar(255)     
  created_at  datetime     
  last_login  datetime NULL   
  </code></pre>
  
  <p>And here is create_user.php:</p>
  
  <pre><code>&lt;?php
  // create_user.php
  use Doctrine\ORM\Mapping as ORM;
  require_once "bootstrap.php";
  require 'vendor/autoload.php';
  use Db\User;
  
  $newUsername = $argv[1];
  
  $user = new User();
  $user-&gt;setName($newUsername);
  
  $entityManager-&gt;persist($user);
  $entityManager-&gt;flush();
  
  echo "Created User with ID " . $user-&gt;getId() . "\n";
  </code></pre>
  
  <p>User.php :</p>
  
  <pre><code>&lt;?php
  // src/User.php
  namespace Db;
  use Doctrine\ORM\Mapping as ORM;
  use Doctrine\Common\Collections\ArrayCollection;
  
  /**
  * @ORM\Entity @ORM\Table(name="user")
  **/
  class User
  {
  /** @ORM\Id @ORM\Column(type="integer") @ORM\GeneratedValue **/
  protected $id;
  
  /** @ORM\Column(type="string") **/
  protected $name;
  
  /** @ORM\Column(type="datetime") **/
  protected $created_at;
  
  /** @ORM\Column(type="datetime", nullable=true) **/
  protected $last_login;
  </code></pre>
  
  <p>I can't see the error because column created_at isn't null.</p>