You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When 'rest_framework.authtoken' is included get the error pq: relation "authtoken_token" already exists. Below is the full error
Error: read state from "django/schema.sql": executing statement: "CREATE TABLE \"authtoken_token\" ();": pq: relation "authtoken_token" already exists
I tried generating the SQL script using " python manage.py atlas-provider-django --dialect "PostgreSQL" , I see the CREATE TABLE "authtoken_token" is there twice". Refer to the below generated script.
The issue is it is trying to create a script for in-herited model TokenProxy.
-- Create model Token
--
CREATE TABLE "authtoken_token" ("key" varchar(40) NOT NULL PRIMARY KEY, "created" timestamp with time zone NOT NULL, "user_id" integer NOT NULL UNIQUE);
--
-- Create proxy model TokenProxy
--
CREATE TABLE "authtoken_token" ();
ALTER TABLE "authtoken_token" ADD CONSTRAINT "authtoken_token_user_id_35299eff_fk_auth_user_id" FOREIGN KEY ("user_id") REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED;
CREATE INDEX "authtoken_token_key_10f0b77e_like" ON "authtoken_token" ("key" varchar_pattern_ops);
--
The text was updated successfully, but these errors were encountered:
saran-greytip
changed the title
When 'rest_framework.authtoken' is included get the error pq: relation "authtoken_token" already exists
When the app 'rest_framework.authtoken' is included in INSTALLED_APPS we get the error pq: relation "authtoken_token" already exists
Jun 19, 2024
When 'rest_framework.authtoken' is included get the error pq: relation "authtoken_token" already exists. Below is the full error
Error: read state from "django/schema.sql": executing statement: "CREATE TABLE \"authtoken_token\" ();": pq: relation "authtoken_token" already exists
I tried generating the SQL script using " python manage.py atlas-provider-django --dialect "PostgreSQL" , I see the CREATE TABLE "authtoken_token" is there twice". Refer to the below generated script.
The issue is it is trying to create a script for in-herited model TokenProxy.
The text was updated successfully, but these errors were encountered: