Heroku:数据库迁移不会创建表

时间:2015-01-25 16:35:09

标签: django heroku

在数据库迁移期间,Heroku不会在每个应用程序中创建models.py中指定的所有表。以下是manage.py migrationsmanage.py migrate的输出(对不起,我必须列出所有消息以便更清楚):

$ heroku run python3 manage.py makemigrations
Running `python3 manage.py makemigrations` attached to terminal... up, run.1919
Migrations for 'customer':
  0001_initial.py:
    - Create model Company
    - Create model Customer
Migrations for 'basicData':
  0001_initial.py:
    - Create model Bus
    - Create model ChargeStandard
    - Create model Employee
    - Create model Flight
    - Create model Phrase
Migrations for 'schedule':
  0001_initial.py:
    - Create model DriverVacation
    - Create model Schedule
Migrations for 'reserve':
  0001_initial.py:
    - Create model Reserve
Migrations for 'sysSetting':
  0001_initial.py:
    - Create model UserProfile

$ heroku run python3 manage.py migrate
Running `python3 manage.py migrate` attached to terminal... up, run.3948
Operations to perform:
  Synchronize unmigrated apps: main, userLogin
  Apply all migrations: sessions, admin, auth, contenttypes
Synchronizing apps without migrations:
  Creating tables...
    Creating table main_chargingmethod
    Creating table main_invoicetype
    Creating table main_delivertype
    Creating table main_currentrecord
  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

makemigrations的输出表明跳过了以下模型:

ChargingMethod
InvoiceType
DeliverType
CurrentRecord

但是,在manage.py migrate期间,只会创建main中的表格。其他人被跳过了。有什么问题?

0 个答案:

没有答案