column "foo" referenced in foreign key constraint does not exist
i got an error when i migrating, the error is this:
PostgresError: column "person_id" referenced in foreign key constraint does not exist
PostgresError: column "person_id" referenced in foreign key constraint does not exist
this is the query that throw error:
DO $$ BEGIN ALTER TABLE "story" ADD CONSTRAINT "story_person_id_person_id_fk" FOREIGN KEY ("person_id") REFERENCES "public"."person"("id") ON DELETE no action ON UPDATE no action;EXCEPTION WHEN duplicate_object THEN null;END $$;
DO $$ BEGIN ALTER TABLE "story" ADD CONSTRAINT "story_person_id_person_id_fk" FOREIGN KEY ("person_id") REFERENCES "public"."person"("id") ON DELETE no action ON UPDATE no action;EXCEPTION WHEN duplicate_object THEN null;END $$;