feat: opcion de update a asignaturas ya creadas para ponerles la información generada con IA
- Created a new enum type "estado_asignatura" with values 'borrador', 'revisada', 'aprobada', and 'generando'. - Added a new column "estado" to the "asignaturas" table, defaulting to 'generando'. - Implemented a trigger function to log changes in the "planes_estudio" table, capturing inserts, updates, and deletes. - Updated the logging mechanism to track changes in various fields, including JSONB data. - Removed the "asignaturas" table from the supabase_realtime publication. - Added a script for generating TypeScript types from the local Supabase database.
This commit is contained in:
@@ -4,14 +4,9 @@
|
||||
| boolean
|
||||
| null
|
||||
| { [key: string]: Json | undefined }
|
||||
| Array<Json>;
|
||||
| Json[];
|
||||
|
||||
export type Database = {
|
||||
// Allows to automatically instantiate createClient with right options
|
||||
// instead of createClient<Database, { PostgrestVersion: 'XX' }>(URL, KEY)
|
||||
__InternalSupabase: {
|
||||
PostgrestVersion: "12.2.3 (519615d)";
|
||||
};
|
||||
graphql_public: {
|
||||
Tables: {
|
||||
[_ in never]: never;
|
||||
@@ -98,6 +93,7 @@ export type Database = {
|
||||
creado_por: string | null;
|
||||
creditos: number;
|
||||
datos: Json;
|
||||
estado: Database["public"]["Enums"]["estado_asignatura"];
|
||||
estructura_id: string | null;
|
||||
horas_academicas: number | null;
|
||||
horas_independientes: number | null;
|
||||
@@ -124,6 +120,7 @@ export type Database = {
|
||||
creado_por?: string | null;
|
||||
creditos: number;
|
||||
datos?: Json;
|
||||
estado?: Database["public"]["Enums"]["estado_asignatura"];
|
||||
estructura_id?: string | null;
|
||||
horas_academicas?: number | null;
|
||||
horas_independientes?: number | null;
|
||||
@@ -150,6 +147,7 @@ export type Database = {
|
||||
creado_por?: string | null;
|
||||
creditos?: number;
|
||||
datos?: Json;
|
||||
estado?: Database["public"]["Enums"]["estado_asignatura"];
|
||||
estructura_id?: string | null;
|
||||
horas_academicas?: number | null;
|
||||
horas_independientes?: number | null;
|
||||
@@ -815,20 +813,18 @@ export type Database = {
|
||||
asignatura_id: string;
|
||||
creado_en?: string;
|
||||
id?: string;
|
||||
rol?:
|
||||
Database["public"]["Enums"][
|
||||
"rol_responsable_asignatura"
|
||||
];
|
||||
rol?: Database["public"]["Enums"][
|
||||
"rol_responsable_asignatura"
|
||||
];
|
||||
usuario_id: string;
|
||||
};
|
||||
Update: {
|
||||
asignatura_id?: string;
|
||||
creado_en?: string;
|
||||
id?: string;
|
||||
rol?:
|
||||
Database["public"]["Enums"][
|
||||
"rol_responsable_asignatura"
|
||||
];
|
||||
rol?: Database["public"]["Enums"][
|
||||
"rol_responsable_asignatura"
|
||||
];
|
||||
usuario_id?: string;
|
||||
};
|
||||
Relationships: [
|
||||
@@ -1126,6 +1122,11 @@ export type Database = {
|
||||
unaccent_immutable: { Args: { "": string }; Returns: string };
|
||||
};
|
||||
Enums: {
|
||||
estado_asignatura:
|
||||
| "borrador"
|
||||
| "revisada"
|
||||
| "aprobada"
|
||||
| "generando";
|
||||
estado_tarea_revision: "PENDIENTE" | "COMPLETADA" | "OMITIDA";
|
||||
fuente_cambio: "HUMANO" | "IA";
|
||||
nivel_plan_estudio:
|
||||
@@ -1233,15 +1234,13 @@ export type TablesInsert<
|
||||
| { schema: keyof DatabaseWithoutInternals },
|
||||
TableName extends DefaultSchemaTableNameOrOptions extends {
|
||||
schema: keyof DatabaseWithoutInternals;
|
||||
}
|
||||
? keyof DatabaseWithoutInternals[
|
||||
} ? keyof DatabaseWithoutInternals[
|
||||
DefaultSchemaTableNameOrOptions["schema"]
|
||||
]["Tables"]
|
||||
: never = never,
|
||||
> = DefaultSchemaTableNameOrOptions extends {
|
||||
schema: keyof DatabaseWithoutInternals;
|
||||
}
|
||||
? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]][
|
||||
} ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]][
|
||||
"Tables"
|
||||
][TableName] extends {
|
||||
Insert: infer I;
|
||||
@@ -1260,15 +1259,13 @@ export type TablesUpdate<
|
||||
| { schema: keyof DatabaseWithoutInternals },
|
||||
TableName extends DefaultSchemaTableNameOrOptions extends {
|
||||
schema: keyof DatabaseWithoutInternals;
|
||||
}
|
||||
? keyof DatabaseWithoutInternals[
|
||||
} ? keyof DatabaseWithoutInternals[
|
||||
DefaultSchemaTableNameOrOptions["schema"]
|
||||
]["Tables"]
|
||||
: never = never,
|
||||
> = DefaultSchemaTableNameOrOptions extends {
|
||||
schema: keyof DatabaseWithoutInternals;
|
||||
}
|
||||
? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]][
|
||||
} ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]][
|
||||
"Tables"
|
||||
][TableName] extends {
|
||||
Update: infer U;
|
||||
@@ -1287,15 +1284,13 @@ export type Enums<
|
||||
| { schema: keyof DatabaseWithoutInternals },
|
||||
EnumName extends DefaultSchemaEnumNameOrOptions extends {
|
||||
schema: keyof DatabaseWithoutInternals;
|
||||
}
|
||||
? keyof DatabaseWithoutInternals[
|
||||
} ? keyof DatabaseWithoutInternals[
|
||||
DefaultSchemaEnumNameOrOptions["schema"]
|
||||
]["Enums"]
|
||||
: never = never,
|
||||
> = DefaultSchemaEnumNameOrOptions extends {
|
||||
schema: keyof DatabaseWithoutInternals;
|
||||
}
|
||||
? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]][
|
||||
} ? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]][
|
||||
"Enums"
|
||||
][EnumName]
|
||||
: DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"]
|
||||
@@ -1308,15 +1303,13 @@ export type CompositeTypes<
|
||||
| { schema: keyof DatabaseWithoutInternals },
|
||||
CompositeTypeName extends PublicCompositeTypeNameOrOptions extends {
|
||||
schema: keyof DatabaseWithoutInternals;
|
||||
}
|
||||
? keyof DatabaseWithoutInternals[
|
||||
} ? keyof DatabaseWithoutInternals[
|
||||
PublicCompositeTypeNameOrOptions["schema"]
|
||||
]["CompositeTypes"]
|
||||
: never = never,
|
||||
> = PublicCompositeTypeNameOrOptions extends {
|
||||
schema: keyof DatabaseWithoutInternals;
|
||||
}
|
||||
? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]][
|
||||
} ? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]][
|
||||
"CompositeTypes"
|
||||
][CompositeTypeName]
|
||||
: PublicCompositeTypeNameOrOptions extends
|
||||
@@ -1330,6 +1323,12 @@ export const Constants = {
|
||||
},
|
||||
public: {
|
||||
Enums: {
|
||||
estado_asignatura: [
|
||||
"borrador",
|
||||
"revisada",
|
||||
"aprobada",
|
||||
"generando",
|
||||
],
|
||||
estado_tarea_revision: ["PENDIENTE", "COMPLETADA", "OMITIDA"],
|
||||
fuente_cambio: ["HUMANO", "IA"],
|
||||
nivel_plan_estudio: [
|
||||
|
||||
Reference in New Issue
Block a user