Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django 1.7 synchronize unmigrated apps

I started my model:

myapp.models.py

class MyModel(models.Model):

    field_a = models.FloatField()
    field_c = models.FloatField()

Then ran ./manage.py migrate on my new project and it was all good:

Operations to perform:
  Synchronize unmigrated apps: myapp
  Apply all migrations: admin, contenttypes, auth, sessions
Synchronizing apps without migrations:
  Creating tables...
    Creating table myapp_mymodel
  Installing custom SQL...
  Installing indexes...
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying sessions.0001_initial... OK

Then I changed my model:

class MyModel(models.Model):

    field_a = models.FloatField()
    field_b = models.FloatField()
    field_c = models.FloatField()

I ran ./manage.py migrate again and nothing happened.

(project)$ ./manage.py migrate 
Operations to perform:
  Synchronize unmigrated apps: myapp
  Apply all migrations: admin, contenttypes, auth, sessions
Synchronizing apps without migrations:
  Creating tables...
  Installing custom SQL...
  Installing indexes...
Running migrations:
  No migrations to apply.

I'm wondering what I need to do to make my new app migrate?

like image 945
Williams Avatar asked Jul 01 '14 06:07

Williams


1 Answers

Ack, answered my own question.

What I needed to do was run:

./manage.py makemigrations myapp
like image 120
Williams Avatar answered Sep 25 '22 01:09

Williams