Merge branch 'main' of https://github.lci.ulsa.mx/AlexRG/genesis-2 into issue/63-aplicar-migraciones-de-asignatura
This commit is contained in:
@@ -1,13 +1,12 @@
|
|||||||
name: Supa-backup
|
name: Supa-backup
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches: [ main ]
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 0 * * *' # Runs every day at midnight
|
- cron: '0 0 * * *' # Runs every day at midnight
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run_db_backup:
|
run_db_backup:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -17,21 +16,27 @@ jobs:
|
|||||||
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_DESARROLLO_ACCESS_TOKEN }}
|
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_DESARROLLO_ACCESS_TOKEN }}
|
||||||
SUPABASE_PROJECT_ID: ${{ secrets.SUPABASE_DESARROLLO_PROJECT_ID }}
|
SUPABASE_PROJECT_ID: ${{ secrets.SUPABASE_DESARROLLO_PROJECT_ID }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.head_ref }}
|
# Si es un PR, usa la rama origen. Si no, usa la rama que disparó el evento (main).
|
||||||
|
ref: ${{ github.head_ref || github.ref }}
|
||||||
|
|
||||||
- uses: supabase/setup-cli@v1
|
- uses: supabase/setup-cli@v1
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
|
|
||||||
- name: Link Project
|
- name: Link Project
|
||||||
run: supabase link --project-ref $SUPABASE_PROJECT_ID
|
run: supabase link --project-ref $SUPABASE_PROJECT_ID
|
||||||
|
|
||||||
- name: Backup roles
|
- name: Backup roles
|
||||||
run: supabase db dump -f supabase/roles.sql --role-only
|
run: supabase db dump -f supabase/roles.sql --role-only
|
||||||
|
|
||||||
- name: Backup schema
|
- name: Backup schema
|
||||||
run: supabase db dump -f supabase/schema.sql
|
run: supabase db dump -f supabase/schema.sql
|
||||||
|
|
||||||
- name: Backup data
|
- name: Backup data
|
||||||
run: supabase db dump -f supabase/data.sql --data-only --use-copy
|
run: supabase db dump -f supabase/data.sql --data-only --use-copy
|
||||||
|
|
||||||
- uses: stefanzweifel/git-auto-commit-action@v4
|
- uses: stefanzweifel/git-auto-commit-action@v5
|
||||||
with:
|
with:
|
||||||
commit_message: Supabase backup
|
commit_message: Supabase backup
|
||||||
+4
-4
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
|||||||
export type Json =
|
export type Json =
|
||||||
| string
|
| string
|
||||||
| number
|
| number
|
||||||
| boolean
|
| boolean
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { corsHeaders } from "../_shared/cors.ts";
|
|||||||
import { HttpError, sendError, sendSuccess } from "../_shared/utils.ts";
|
import { HttpError, sendError, sendSuccess } from "../_shared/utils.ts";
|
||||||
import { createClient } from "@supabase/supabase-js";
|
import { createClient } from "@supabase/supabase-js";
|
||||||
import type { Database, Json } from "../_shared/database.types.ts";
|
import type { Database, Json } from "../_shared/database.types.ts";
|
||||||
|
import { definicionesDeEstructurasDeColumnas } from "../_shared/estructuras.ts";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import {
|
import {
|
||||||
OpenAIService,
|
OpenAIService,
|
||||||
@@ -599,98 +600,3 @@ Deno.serve(async (req: Request): Promise<Response> => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const definicionesDeEstructurasDeColumnas = {
|
|
||||||
contenido_tematico: {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"x-column": {
|
|
||||||
"type": "string",
|
|
||||||
"enum": [
|
|
||||||
"contenido_tematico",
|
|
||||||
],
|
|
||||||
},
|
|
||||||
"x-definicion": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"unidad": {
|
|
||||||
"type": "integer",
|
|
||||||
},
|
|
||||||
"titulo": {
|
|
||||||
"type": "string",
|
|
||||||
},
|
|
||||||
"temas": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"nombre": {
|
|
||||||
"type": "string",
|
|
||||||
},
|
|
||||||
"horasEstimadas": {
|
|
||||||
"type": "integer",
|
|
||||||
"description":
|
|
||||||
"Horas del tema. La suma de todas las horasEstimadas debe ser igual a las horas académicas del prompt.",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"nombre",
|
|
||||||
"horasEstimadas",
|
|
||||||
],
|
|
||||||
"additionalProperties": false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"unidad",
|
|
||||||
"titulo",
|
|
||||||
"temas",
|
|
||||||
],
|
|
||||||
"additionalProperties": false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"x-column",
|
|
||||||
"x-definicion",
|
|
||||||
],
|
|
||||||
"additionalProperties": false,
|
|
||||||
},
|
|
||||||
criterios_de_evaluacion: {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"x-column": {
|
|
||||||
"type": "string",
|
|
||||||
"enum": [
|
|
||||||
"criterios_de_evaluacion",
|
|
||||||
],
|
|
||||||
},
|
|
||||||
"x-definicion": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"criterio": {
|
|
||||||
"type": "string",
|
|
||||||
},
|
|
||||||
"porcentaje": {
|
|
||||||
"type": "integer",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"criterio",
|
|
||||||
"porcentaje",
|
|
||||||
],
|
|
||||||
"additionalProperties": false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"x-column",
|
|
||||||
"x-definicion",
|
|
||||||
],
|
|
||||||
"additionalProperties": false,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|||||||
Reference in New Issue
Block a user