drop view if exists "public"."plantilla_plan";

alter table "public"."asignaturas" add column "conversation_id" text;

CREATE UNIQUE INDEX asignaturas_conversation_id_key ON public.asignaturas USING btree (conversation_id);

alter table "public"."asignaturas" add constraint "asignaturas_conversation_id_key" UNIQUE using index "asignaturas_conversation_id_key";

create or replace view "public"."plantilla_plan" as  SELECT plan.id AS plan_estudio_id,
    struct.id AS estructura_id,
    struct.template_id
   FROM (public.planes_estudio plan
     JOIN public.estructuras_plan struct ON ((plan.estructura_id = struct.id)));



