【发布时间】:2017-05-03 03:39:05
【问题描述】:
我已将我的项目从 MySQL 转移到 PostgreSQL 并尝试删除该列作为先前问题的结果,因为在我从 models.py 中删除有问题的列并保存之后。错误甚至没有消失。 Integer error transferring from MySQL to PostgreSQL
加引号和不加引号都试过了。
ALTER TABLE "UserProfile" DROP COLUMN how_many_new_notifications;
或者:
ALTER TABLE UserProfile DROP COLUMN how_many_new_notifications;
获取以下信息:
ERROR: relation "UserProfile" does not exist
这是一个模型,如果有帮助:
class UserProfile(models.Model):
user = models.OneToOneField(User)
how_many_new_notifications = models.IntegerField(null=True,default=0)
User.profile = property(lambda u: UserProfile.objects.get_or_create(user=u)[0])
我认为这可能与大小写混合有关,但我没有通过所有类似问题找到解决方案。
【问题讨论】:
-
不带双引号试试。
-
@Gordon Linoff 哦,是的,两者都试过了。这是我找到并尝试过的一种解决方案
标签: mysql django postgresql