#3253 (Postgres : relation "django_content_type" does not exist)
by khchine5 · in Developers · assigned to Sharif Mehedi
Summary
When we use postgresql as a database we get the following error when running prep command:
psycopg2.errors.UndefinedTable: relation "django_content_type" does not exist
Children
Comments
- 4 years, 6 months ago by Sharif Mehedi about #3253 (Postgres : relation "django_content_type" does not exist) : `pm prep` successfully executes on postgres. Did not subclass `makemigrations`. For the moment we are catching CicularDependencyError and ignoring it. CircularDependencyError is being raised due to the inject_field function calls from other plugins which is NOT an error in reality and which django d...
- 4 years, 6 months ago by Sharif Mehedi about #3253 (Postgres : relation "django_content_type" does not exist) : Here in [url gitlab.com/lino-framework/lino/-/blob/c43f5e0a5dcfc4914607966a8b8258aa28c5cd52/lino/core/fields.py#L883 fields.py] it is clearly stated (and I also checked) that a dd.DurationField is a django.db.models.CharField but here in [url gitlab.com/lino-framework/xl/-/blob/10eb1c6832d5f715223a8...
- 4 years, 6 months ago by Luc Saffre about #3253 (Postgres : relation "django_content_type" does not exist) : Good work. Yes, we never used postgresql so far bcause of such "minor" issues. And because there was no need. But it is good to finally get them fixed, now that we have gitlab for testing.
- 4 years, 6 months ago by Sharif Mehedi about #3253 (Postgres : relation "django_content_type" does not exist) : this issue goes away when we call makemigrations on each app. And at the end there maybe another failure django.db.migrations.exceptions.CircularDependencyError. I am thinking about subclassing the makemigrations command and customize the method that resolves circular dependency.
- 4 years, 6 months ago by Sharif Mehedi about #3253 (Postgres : relation "django_content_type" does not exist) : I am getting similar failure. And I think this is related to the ordering of table insertion (creation). We probably need to review how deferredSQL is done.