1

I am trying to do ./manage.py migrate in my django project but it results in

django.db.utils.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for t
he right syntax to use near '[] NOT NULL, `Y` double precision[] NOT NULL, `Viewtimestamp` datetime NOT NULL)' at line 1")

There is no compatibily issue according to documentation and answer here. I also tried this but no luck.

My Django version is 2.2.5

Mysql - Ver 14.14 Distrib 5.7.23,

mysqlclient version - 1.4.5

models.py

from django.db import models
from django.contrib.auth.models import User
from django.contrib.postgres.fields import ArrayField
# Create your models here.
class Products(models.Model):
    title = models.CharField(max_length = 100)
    description = models.TextField()
    views = models.FloatField(null = True)
    image = models.ImageField(upload_to = 'productImages/')
    dateUploaded =  models.DateField(auto_now_add=True)
    Daytimestamp = models.DateField(auto_now_add=True)
    actualViews = models.IntegerField(null = True)

    class Meta:
        ordering = ['title']

class Views(models.Model):
    X = ArrayField(models.IntegerField(blank = True))
    Y = ArrayField(models.FloatField(blank= True))
    Viewtimestamp = models.DateTimeField(auto_now_add=True)

ThatMan
  • 115
  • 8

0 Answers0