MicroFrameWork/migrations/AnswerMigration.php

37 lines
840 B
PHP
Raw Normal View History

2024-07-10 14:39:37 +03:00
<?php
namespace migrations;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Capsule\Manager;
class AnswerMigration extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public static function up(): void
{
Manager::schema()->create('answer', function (Blueprint $table) {
$table->increments('id');
$table->string('answer', 255)->nullable(false);
$table->integer('user_id');
$table->integer('question_id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public static function down(): void
{
Manager::schema()->dropIfExists('user');
}
}