Django Version 4.1 I have created migration in SQLite3 and want to change to Postgresql when i connect to Postgresql i've this error
django.db.utils.ProgrammingError: cannot cast type smallint to boolean
LINE 1: ...R COLUMN "isProduct" TYPE boolean USING "isProduct"::boolean
this is my model
from django.db import models
class Item(models.Model):
name = models.CharField(max_length = 150)
slug = models.SlugField(unique = True, db_index=True, null=True)
pic = models.URLField(max_length = 400)
address = models.CharField(max_length = 150)
phone = models.CharField(max_length = 15)
price = models.IntegerField()
original_link = models.URLField(max_length = 400)
description = models.TextField(max_length = 1500)
additional_desc = models.TextField(max_length = 1500,default='')
material = models.TextField(max_length = 200, default = '')
weight = models.DecimalField(max_digits = 12, decimal_places = 2, default = 0)
weight_unit = models.CharField(max_length = 4, default = '')
color = models.CharField(max_length = 50, default = '')
dimension_length = models.DecimalField(max_digits = 12, decimal_places = 2, default = 0)
dimension_width = models.DecimalField(max_digits = 12, decimal_places = 2, default = 0)
dimension_height = models.DecimalField(max_digits = 12, decimal_places = 2, default = 0)
dimension_unit = models.CharField(max_length = 4, default='')
isProduct = models.BooleanField(default = True)
furniture_location = models.CharField(max_length = 100, default='')
def __str__(self):
return self.name
i've tried to change BooleanField to SmallIntegerField, PositiveSmallIntegerField, and IntegerField and the error still says the same thing
How to fix this error because this error prevent sessions and contenttype table to be migrated