Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am getting error while making migrate on django 2.1 application

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'),
        ),
    ]

Error:

 Applying sawy.0006_auto_20190418_0608...Traceback 
....
....
....

django.db.utils.ProgrammingError: syntax error at or near "WITH ORDINALITY" LINE 6:
  • Python Version : 3.6
  • django Version : 2.1.4
  • DB: Postgres

Edit

Modal

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
like image 754
Saurabh Chandra Patel Avatar asked Apr 18 '19 06:04

Saurabh Chandra Patel


1 Answers

Django 2.1 have dropped support for postgres 9.3

try to update your postgres version

django 2.1 release note

like image 115
rahul.m Avatar answered Sep 19 '22 15:09

rahul.m