gpt4 book ai didi

python - django.db.utils.ProgrammingError : syntax error at or near "WITH ORDINALITY" LINE 6:

转载 作者:行者123 更新时间:2023-12-03 18:45:06 26 4
gpt4 key购买 nike

在 django 2.1 应用程序上进行迁移时出现错误

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('sawy', '0005_auto_20190418_0607'),
]

operations = [
migrations.AlterField(
model_name='response',
name='action',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='response', to='sawy.Action'),
),
]

错误:
 Applying sawy.0006_auto_20190418_0608...Traceback 
....
....
....

django.db.utils.ProgrammingError: syntax error at or near "WITH ORDINALITY" LINE 6:
  • Python 版本:3.6
  • Django 版本:2.1.4
  • 数据库:Postgres

  • 编辑

    模态
    class Response(models.Model):
    action = models.ForeignKey(Action, on_delete=models.CASCADE, related_name='response')
    text = models.TextField(blank=True,unique=True)
    def __str__(self):
    return self.text

    最佳答案

    Django 2.1 不再支持 postgres 9.3

    尝试更新您的 postgres 版本

    Django 2.1 发布 note

    关于python - django.db.utils.ProgrammingError : syntax error at or near "WITH ORDINALITY" LINE 6:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55740085/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com