错误信息
django.db.utils.OperationalError:没有这样的表:clientauth_tbltokentypes
我想要做什么
我正在尝试使用表生成迁移数据。
模型.py
class tbltokentypes(models.Model):
token_type_id: AutoField(primary_key=True)
token_type: CharField(max_length=30)
我运行了python manage.py makemigrations
创建文件 0001_initial.py 的命令。
然后在迁移文件中,我添加了管理器:
from django.db import migrations, models
from clientauth.models import tbltokentypes
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='tbltokentypes',
fields=[
('token_type_id', models.AutoField(primary_key=True, serialize=False, verbose_name='token_type_id')),
('token_type', models.CharField(max_length=30)),
],
managers=[
tbltokentypes(token_type = "Registration").save()
]
)
]
我错过了什么吗?