运行django auth迁移不会在db中创建表

时间:2018-09-07 07:00:33

标签: django django-migrations

我使用django已有很多年了,但之前从未见过此类问题。

我正在从事旧/旧项目。而且我本来面对this issue。因此,正如该解决方案所建议的那样,我首先运行auth迁移,

$python manage.py migrate auth
Operations to perform:
Apply all migrations: auth
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying auth.0007_alter_validators_add_error_messages... OK
  Applying auth.0008_alter_user_username_max_length... OK

但是当我检查mysql数据库时,仅创建django_migrations表。我看不到auth_userauth_groupauth_permissions等。

$python manage.py showmigrations auth
auth
 [X] 0001_initial
 [X] 0002_alter_permission_name_max_length
 [X] 0003_alter_user_email_max_length
 [X] 0004_alter_user_username_opts
 [X] 0005_alter_user_last_login_null
 [X] 0006_require_contenttypes_0002
 [X] 0007_alter_validators_add_error_messages
 [X] 0008_alter_user_username_max_length

mysql> show tables;
django_migrations

我正在使用Python3.6Django==1.11.5。我的INSTALLED_APPS看起来像这样,

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.humanize',
    'debug_toolbar',
    'djcelery',
    'widget_tweaks',
    'djangosaml2',

    # ... more apps from my project
]

可能是什么问题?有没有人遇到过这样的问题。

0 个答案:

没有答案