Files
Faculty-Documentation/database/migrations/2025_01_25_201943_create_responses_table.php
2025-01-26 02:13:19 +05:30

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');
}
}