39 lines
1.0 KiB
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');
|
|
}
|
|
}
|