changeweb/Unifiedtransform

View on GitHub
database/migrations/2021_08_29_083934_create_attendances_table.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAttendancesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('attendances', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('course_id')->default(0);
            $table->unsignedInteger('class_id')->default(0);
            $table->unsignedInteger('section_id')->default(0);
            $table->unsignedInteger('student_id');
            $table->string('status');
            $table->unsignedInteger('session_id');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('attendances');
    }
}