staffmanager/database/migrations/2020_04_29_030107_create_re...

40 lines
915 B
PHP
Raw Permalink Normal View History

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateResponsesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('responses', function (Blueprint $table) {
$table->id();
2020-04-29 20:56:41 +00:00
$table->bigInteger('responseFormID')->unsigned();
$table->longText('responseData');
$table->timestamps();
// A better way would be to link responses directly to vacancies, that subsquently have a form
$table->foreign('responseFormID')
->references('id')
->on('forms');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('responses');
}
}