title: Django migration: all the columns are not generated as the model
body: <p>For all the tables some of columns are generated and some of columns didn't.</p>
  
  <p>Here is my models</p>
  
  <p>personalInfo.py</p>
  
  <pre><code>from django.db import models
  
  # Create your models here.
  
  class Students(models.Model):
      student_name = models.CharField(max_length=100)
      student_id = models.CharField(max_length=50)
      student_dept = models.CharField(max_length=30)
      student_sec = models.CharField(max_length=2)
  
  class StudentDetails(models.Model):
      students = models.ForeignKey(Students, on_delete=models.CASCADE)
      present_address = models.TextField
      permanent_address = models.TextField
      student_phone = models.BigIntegerField
      gpo_box_number = models.IntegerField
  
  class Teachers(models.Model):
      teacher_name = models.CharField(max_length=100)
      teacher_id = models.CharField(max_length=50)
      teacher_dept = models.CharField(max_length=30)
  
  class TeacherDetails(models.Model):
      teachers = models.ForeignKey(Teachers, on_delete=models.CASCADE)
      present_address = models.TextField
      permanent_address = models.TextField
      teacher_phone = models.BigIntegerField
      gpo_box_number = models.IntegerField
  </code></pre>
  
  <p>studentAdvising.py</p>
  
  <pre><code>from django.db import models
  from personalInfo.models import Students, Teachers
  
  # Create your models here.
  
  class Advising(models.Model):
      student = models.ForeignKey(Students, on_delete=models.CASCADE)
      teacher = models.ForeignKey(Teachers, on_delete=models.CASCADE)
      subject_matter = models.CharField(max_length=400)
      comment = models.TextField
      starting_time = models.TimeField
      ending_time = models.TimeField
      date = models.DateField
  </code></pre>
  
  <p>migration details for personalInfo.py</p>
  
  <pre><code># Generated by Django 2.0 on 2018-01-03 17:43
  
  from django.db import migrations, models
  import django.db.models.deletion
  
  
  class Migration(migrations.Migration):
  
      initial = True
  
      dependencies = [
      ]
  
      operations = [
          migrations.CreateModel(
              name='StudentDetails',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
              ],
          ),
          migrations.CreateModel(
              name='Students',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('student_name', models.CharField(max_length=100)),
                  ('student_id', models.CharField(max_length=50)),
                  ('student_dept', models.CharField(max_length=30)),
                  ('student_sec', models.CharField(max_length=2)),
              ],
          ),
           migrations.CreateModel(
              name='TeacherDetails',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
              ],
          ),
          migrations.CreateModel(
              name='Teachers',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('teacher_name', models.CharField(max_length=100)),
                  ('teacher_id', models.CharField(max_length=50)),
                  ('teacher_dept', models.CharField(max_length=30)),
               ],
          ),
          migrations.AddField(
              model_name='teacherdetails',
              name='teachers',
  
  field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='personalInfo.Teachers'),
          ),
          migrations.AddField(
              model_name='studentdetails',
              name='students',
  
  field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='personalInfo.Students'),
          ),
      ]
  </code></pre>
  
  <p>migration details for studentAdvising</p>
  
  <pre><code># Generated by Django 2.0 on 2018-01-03 17:43
  
  from django.db import migrations, models
  import django.db.models.deletion
  
  
  class Migration(migrations.Migration):
  
      initial = True
  
      dependencies = [
          ('personalInfo', '0001_initial'),
      ]
  
      operations = [
          migrations.CreateModel(
              name='Advising',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('subject_matter', models.CharField(max_length=400)),
                  ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='personalInfo.Students')),
                  ('teacher', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='personalInfo.Teachers')),
              ],
          ),
      ]
  </code></pre>
  
  <p>tables in database,</p>
  
  <pre><code>mysql&gt; show tables;
  +-----------------------------+
  | Tables_in_studentAdvising   |
  +-----------------------------+
  | auth_group                  |
  | auth_group_permissions      |
  | auth_permission             |
  | auth_user                   |
  | auth_user_groups            |
  | auth_user_user_permissions  |
  | django_admin_log            |
  | django_content_type         |
  | django_migrations           |
  | django_session              |
  | personalInfo_studentdetails |
  | personalInfo_students       |
  | personalInfo_teacherdetails |
  | personalInfo_teachers       |
  | studentAdvisingApp_advising |
  +-----------------------------+
  15 rows in set (0.00 sec)
  
  
  mysql&gt; SHOW COLUMNS FROM personalInfo_students;
  +--------------+--------------+------+-----+---------+----------------+
  | Field        | Type         | Null | Key | Default | Extra          |
  +--------------+--------------+------+-----+---------+----------------+
  | id           | int(11)      | NO   | PRI | NULL    | auto_increment |
  | student_name | varchar(100) | NO   |     | NULL    |                |
  | student_id   | varchar(50)  | NO   |     | NULL    |                |
  | student_dept | varchar(30)  | NO   |     | NULL    |                |
  | student_sec  | varchar(2)   | NO   |     | NULL    |                |
  +--------------+--------------+------+-----+---------+----------------+
  5 rows in set (0.00 sec)
  
  
  mysql&gt; SHOW COLUMNS FROM personalInfo_studentdetails;
  +-------------+---------+------+-----+---------+----------------+
  | Field       | Type    | Null | Key | Default | Extra          |
  +-------------+---------+------+-----+---------+----------------+
  | id          | int(11) | NO   | PRI | NULL    | auto_increment |
  | students_id | int(11) | NO   | MUL | NULL    |                |
  +-------------+---------+------+-----+---------+----------------+
  2 rows in set (0.00 sec)
  
  
  mysql&gt; SHOW COLUMNS FROM personalInfo_teachers;
  +--------------+--------------+------+-----+---------+----------------+
  | Field        | Type         | Null | Key | Default | Extra          |
  +--------------+--------------+------+-----+---------+----------------+
  | id           | int(11)      | NO   | PRI | NULL    | auto_increment |
  | teacher_name | varchar(100) | NO   |     | NULL    |                |
  | teacher_id   | varchar(50)  | NO   |     | NULL    |                |
  | teacher_dept | varchar(30)  | NO   |     | NULL    |                |
  +--------------+--------------+------+-----+---------+----------------+
  4 rows in set (0.00 sec)
  
  
  mysql&gt; SHOW COLUMNS FROM personalInfo_teacherdetails;
  +-------------+---------+------+-----+---------+----------------+
  | Field       | Type    | Null | Key | Default | Extra          |
  +-------------+---------+------+-----+---------+----------------+
  | id          | int(11) | NO   | PRI | NULL    | auto_increment |
  | teachers_id | int(11) | NO   | MUL | NULL    |                |
  +-------------+---------+------+-----+---------+----------------+
  2 rows in set (0.00 sec)
  
  mysql&gt; SHOW COLUMNS FROM studentAdvisingApp_advising;
  +----------------+--------------+------+-----+---------+----------------+
  | Field          | Type         | Null | Key | Default | Extra          |
  +----------------+--------------+------+-----+---------+----------------+
  | id             | int(11)      | NO   | PRI | NULL    | auto_increment |
  | subject_matter | varchar(400) | NO   |     | NULL    |                |
  | student_id     | int(11)      | NO   | MUL | NULL    |                |
  | teacher_id     | int(11)      | NO   | MUL | NULL    |                |
  +----------------+--------------+------+-----+---------+----------------+
  4 rows in set (0.00 sec)
  </code></pre>
  
  <p>I can't understand where the problem is. And there is no good informaton about it on google. What should I do??</p>