This repository has been archived on 2021-01-24. You can view files and clone it, but cannot push or open issues or pull requests.
laravel-elearning/database/migrations/2016_08_31_145706_create_testdetails_table.php

39 lines
1.0 KiB
PHP

<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTestdetailsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('testdetails', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->unsigned()->index();
$table->integer('test_id')->unsigned()->index();
$table->integer('passed')->unsigned()->default(0);
$table->integer('correct_answers')->unsigned();
$table->integer('fails')->unsigned()->nullable();
$table->integer('passes')->unsigned()->nullable();
$table->timestamp('last_passed')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('testdetails');
}
}