Created
January 15, 2020 02:58
-
-
Save parzibyte/30c937a4e0ad829635cf598b0dbdebd6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Database\Migrations\Migration; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Support\Facades\Schema; | |
class CrearTablaAsistencia extends Migration | |
{ | |
/** | |
* Run the migrations. | |
* | |
* @return void | |
*/ | |
public function up() | |
{ | |
Schema::create('asistencia', function (Blueprint $table) { | |
$table->bigIncrements('id'); | |
$table->unsignedBigInteger('id_alumno'); | |
$table->dateTime("fecha_y_hora"); | |
$table->enum("estado", ["a", "r", "f"]);//asistencia,retardo,falta | |
$table->foreign("id_alumno") | |
->references("id") | |
->on("alumnos") | |
->onDelete("cascade") | |
->onUpdate("cascade"); | |
}); | |
} | |
/** | |
* Reverse the migrations. | |
* | |
* @return void | |
*/ | |
public function down() | |
{ | |
Schema::dropIfExists('asistencia'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment