title: Integrity Constrains Violation issue : Cakephp 3.x
body: <p>I just want to import csv file data to the database table. All fields were inserted successfully except my custom field that is date field(added_date).</p>
  
  <p>It is display the error that.</p>
  
  <pre><code>Error: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'added_date' cannot be null  
  </code></pre>
  
  <p>And below is my code for insertion csv data.</p>
  
  <pre><code>while (($emapData = fgetcsv($file, 10000, ",")) !== FALSE)
  {
      $rs[$cnt]['client_id'] = $emapData[0];
      $rs[$cnt]['name'] = $emapData[1];
      $rs[$cnt]['address1'] = $emapData[3];
      $rs[$cnt]['address2'] = $emapData[4];
      $rs[$cnt]['county'] = $emapData[8];
      $rs[$cnt]['city'] = $emapData[6];
      $rs[$cnt]['country'] = $emapData[8];
      $rs[$cnt]['postcode'] = $emapData[7];
      $rs[$cnt]['email_label'] = $emapData[14];
      $rs[$cnt]['time_spent_on_site'] = $emapData[20];
      $rs[$cnt]['added_date'] = date('Y-m-d H:i:s'); &lt;== gives error that integrity constrains violation.
  
      $cnt++;
  }
  
  fclose($file);
  
  if (count($rs) &gt; 0)
  {
      $customers = TableRegistry::get('Customers');
      $entities = $customers-&gt;newEntities($rs);
  
      $customers-&gt;connection()-&gt;transactional(function () use ($customers, $entities) {
          foreach ($entities as $entity)
          {
              $customers-&gt;save($entity);
          }
      });
  }
  </code></pre>
  
  <p>And database table structure is as follows:</p>
  
  <p><a href="https://i.stack.imgur.com/apN3V.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/apN3V.jpg" alt="enter image description here"></a></p>
  
  <p>Thanks you so much. </p>