Modificación del userController para el cambnio de rol si es alumno o docente

This commit is contained in:
2026-05-05 18:33:36 -06:00
parent 59b7ff87f3
commit 91d0813a9c
21 changed files with 1267 additions and 165 deletions
@@ -0,0 +1,22 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('preguntas', function (Blueprint $table) {
$table->boolean('es_docente')->default(false)->after('requerida');
});
}
public function down(): void
{
Schema::table('preguntas', function (Blueprint $table) {
$table->dropColumn('es_docente');
});
}
};
@@ -0,0 +1,24 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('respuestas', function (Blueprint $table) {
$table->unsignedBigInteger('docente_id')->nullable()->after('opcion_id');
$table->foreign('docente_id')->references('id')->on('docentes')->nullOnDelete();
});
}
public function down(): void
{
Schema::table('respuestas', function (Blueprint $table) {
$table->dropForeign(['docente_id']);
$table->dropColumn('docente_id');
});
}
};