Supabase backup

This commit is contained in:
AlexRG
2026-03-12 14:20:53 +00:00
committed by github-actions[bot]
parent 76dcf24991
commit 0a1f61f587
3 changed files with 2677 additions and 2375 deletions
+2437 -2157
View File
File diff suppressed because one or more lines are too long
+13
View File
@@ -0,0 +1,13 @@
SET default_transaction_read_only = off;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
ALTER ROLE "anon" SET "statement_timeout" TO '3s';
ALTER ROLE "authenticated" SET "statement_timeout" TO '8s';
ALTER ROLE "authenticator" SET "statement_timeout" TO '8s';
RESET ALL;
+21 -12
View File
@@ -1,5 +1,6 @@
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
@@ -442,6 +443,8 @@ begin
'ACTUALIZACION'::public.tipo_cambio, 'tipo_origen', to_jsonb(old.tipo_origen), to_jsonb(new.tipo_origen), null);
end if;
-- 🔥 consumirlo para que NO se guarde en planes_estudio
if v_response_id is not null then
new.meta_origen := new.meta_origen - 'response_id';
@@ -570,9 +573,9 @@ CREATE TABLE IF NOT EXISTS "public"."asignaturas" (
"actualizado_por" "uuid",
"creado_en" timestamp with time zone DEFAULT "now"() NOT NULL,
"actualizado_en" timestamp with time zone DEFAULT "now"() NOT NULL,
"asignatura_hash" "text" GENERATED ALWAYS AS ("encode"(SUBSTRING("extensions"."digest"(("id")::"text", 'sha512'::"text") FROM 1 FOR 12), 'hex'::"text")) STORED,
"horas_academicas" integer,
"horas_independientes" integer,
"asignatura_hash" "text" GENERATED ALWAYS AS ("encode"(SUBSTRING("extensions"."digest"(("id")::"text", 'sha512'::"text") FROM 1 FOR 12), 'hex'::"text")) STORED,
"estado" "public"."estado_asignatura" DEFAULT 'borrador'::"public"."estado_asignatura" NOT NULL,
"criterios_de_evaluacion" "jsonb" DEFAULT '[]'::"jsonb" NOT NULL,
CONSTRAINT "asignaturas_ciclo_chk" CHECK ((("numero_ciclo" IS NULL) OR ("numero_ciclo" > 0))),
@@ -591,11 +594,11 @@ CREATE TABLE IF NOT EXISTS "public"."bibliografia_asignatura" (
"asignatura_id" "uuid" NOT NULL,
"tipo" "public"."tipo_bibliografia" NOT NULL,
"cita" "text" NOT NULL,
"tipo_fuente" "public"."tipo_fuente_bibliografia" DEFAULT 'MANUAL'::"public"."tipo_fuente_bibliografia" NOT NULL,
"biblioteca_item_id" "text",
"creado_por" "uuid",
"creado_en" timestamp with time zone DEFAULT "now"() NOT NULL,
"actualizado_en" timestamp with time zone DEFAULT "now"() NOT NULL
"actualizado_en" timestamp with time zone DEFAULT "now"() NOT NULL,
"referencia_biblioteca" "text",
"referencia_en_linea" "text"
);
@@ -635,10 +638,6 @@ CREATE TABLE IF NOT EXISTS "public"."cambios_plan" (
ALTER TABLE "public"."cambios_plan" OWNER TO "postgres";
COMMENT ON COLUMN "public"."cambios_plan"."response_id" IS 'El ID de respuesta de OpenAI';
CREATE TABLE IF NOT EXISTS "public"."carreras" (
"id" "uuid" DEFAULT "gen_random_uuid"() NOT NULL,
"facultad_id" "uuid" NOT NULL,
@@ -664,7 +663,8 @@ CREATE TABLE IF NOT EXISTS "public"."conversaciones_asignatura" (
"creado_en" timestamp with time zone DEFAULT "now"() NOT NULL,
"archivado_por" "uuid",
"archivado_en" timestamp with time zone,
"intento_archivado" integer DEFAULT 0 NOT NULL
"intento_archivado" integer DEFAULT 0 NOT NULL,
"nombre" "text" DEFAULT ('Chat '::"text" || CURRENT_DATE)
);
@@ -845,10 +845,10 @@ CREATE OR REPLACE VIEW "public"."plantilla_asignatura" AS
JOIN "public"."estructuras_asignatura" "struct" ON (("asignaturas"."estructura_id" = "struct"."id")));
ALTER TABLE "public"."plantilla_asignatura" OWNER TO "postgres";
ALTER VIEW "public"."plantilla_asignatura" OWNER TO "postgres";
CREATE OR REPLACE VIEW "public"."plantilla_plan" WITH ("security_invoker"='on') AS
CREATE OR REPLACE VIEW "public"."plantilla_plan" AS
SELECT "plan"."id" AS "plan_estudio_id",
"struct"."id" AS "estructura_id",
"struct"."template_id"
@@ -856,7 +856,7 @@ CREATE OR REPLACE VIEW "public"."plantilla_plan" WITH ("security_invoker"='on')
JOIN "public"."estructuras_plan" "struct" ON (("plan"."estructura_id" = "struct"."id")));
ALTER TABLE "public"."plantilla_plan" OWNER TO "postgres";
ALTER VIEW "public"."plantilla_plan" OWNER TO "postgres";
CREATE TABLE IF NOT EXISTS "public"."responsables_asignatura" (
@@ -1429,10 +1429,18 @@ ALTER PUBLICATION "supabase_realtime" OWNER TO "postgres";
ALTER PUBLICATION "supabase_realtime" ADD TABLE ONLY "public"."asignatura_mensajes_ia";
ALTER PUBLICATION "supabase_realtime" ADD TABLE ONLY "public"."asignaturas";
ALTER PUBLICATION "supabase_realtime" ADD TABLE ONLY "public"."plan_mensajes_ia";
ALTER PUBLICATION "supabase_realtime" ADD TABLE ONLY "public"."planes_estudio";
@@ -1989,5 +1997,6 @@ ALTER DEFAULT PRIVILEGES FOR ROLE "postgres" IN SCHEMA "public" GRANT ALL ON TAB