title: Django: Field 'X' doesn't have a default value
body: <p>The models.py of my table is :</p>
  
  <pre><code>class TestCaseGlobalMetricData(models.Model):
      testRunData = models.ForeignKey(TestRunData)
      testCase = models.CharField(max_length=200)
      cvmTotalFree = models.IntegerField(default=0)
      systemFree = models.IntegerField(default=0)
      sharedMemory = models.IntegerField(default=0)
  </code></pre>
  
  <p>And the part of the code which uses this table is </p>
  
  <pre><code>TestCaseGlobalMetricData(testRunData=testRunDataObj,
                      testCase=tokens['tc_name'],
                      timestamp=tokens['timestamp'],
                      cvmTotalFree=totalFree).save()
  </code></pre>
  
  <p>When this line is executed the following error is seen,</p>
  
  <pre><code>File "/web/memmon/eink-memmon/projects/process.py", line 382, in process_cvm_usage
      cvmTotalFree=totalFree).save()
  
  .....
  
  Warning: Field 'sharedMemory' doesn't have a default value
  </code></pre>
  
  <p>I tried inserting into the table using the <code>python manage.py shell</code> and it works fine.</p>
  
  <p>The schema of the table as seen in mysql is</p>
  
  <pre><code>+-----------------+--------------+------+-----+---------+----------------+
  | Field           | Type         | Null | Key | Default | Extra          |
  +-----------------+--------------+------+-----+---------+----------------+
  | id              | int(11)      | NO   | PRI | NULL    | auto_increment | 
  | testRunData_id  | int(11)      | NO   | MUL | NULL    |                | 
  | testCase        | varchar(200) | NO   |     | NULL    |                | 
  | cvmTotalFree    | int(11)      | NO   |     | NULL    |                | 
  | systemFree      | int(11)      | NO   |     | NULL    |                | 
  | sharedMemory    | int(11)      | NO   |     | NULL    |                | 
  +-----------------+--------------+------+-----+---------+----------------+
  </code></pre>
  
  <p>Note:
  The field <code>sharedMemory</code> was added in the <code>models.py</code> today. I did proper migrations using <code>makemigrations</code> and <code>migrate</code> commands.</p>