Files
nexusphp/database/migrations/2021_06_08_113437_create_pollanswers_table.php
T
2026-04-14 13:12:56 +07:00

37 lines
870 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePollanswersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if (Schema::hasTable('pollanswers')) {
return;
}
Schema::create('pollanswers', function (Blueprint $table) {
$table->increments('id');
$table->unsignedMediumInteger('pollid')->default(0)->index();
$table->unsignedMediumInteger('userid')->default(0)->index();
$table->unsignedTinyInteger('selection')->default(0)->index();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('pollanswers');
}
}