30 lines
818 B
PHP
30 lines
818 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class CreateResponsesTable extends Migration
|
|
{
|
|
public function up()
|
|
{
|
|
Schema::create('responses', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('title');
|
|
$table->string('activity_type');
|
|
$table->date('start_date');
|
|
$table->date('end_date');
|
|
$table->string('proof')->nullable();
|
|
$table->unsignedBigInteger('faculty_id'); // Ensure it is unsignedBigInteger
|
|
$table->foreign('faculty_id')->references('id')->on('users')->onDelete('cascade'); // Add the foreign key constraint
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('responses');
|
|
}
|
|
}
|