File: /var/www/html/eva.sumar.com.py/database/migrations/2021_08_17_160521_create_respuestas_table.php
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateRespuestasTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('respuestas', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('interrogante_id');
$table->foreign('interrogante_id')->references('id')->on('interrogantes');
$table->longText('respuesta');
$table->longText('respuesta2')->nullable();
$table->unsignedBigInteger('usuario_id');
$table->foreign('usuario_id')->references('id')->on('users');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('respuestas');
}
}