Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/30c937a4e0ad829635cf598b0dbdebd6 to your computer and use it in GitHub Desktop.
Save parzibyte/30c937a4e0ad829635cf598b0dbdebd6 to your computer and use it in GitHub Desktop.
<?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