Add: New Fields for the form

This commit is contained in:
Sallu9007
2025-01-27 01:05:01 +05:30
parent beb4adfaef
commit 5e04bf4afc
6 changed files with 326 additions and 80 deletions

View File

@@ -6,20 +6,29 @@ use Illuminate\Support\Facades\Schema;
class CreateResponsesTable extends Migration
{
// Updated 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();
});
}
{
Schema::create('responses', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->string('organising_institute');
$table->text('address');
$table->unsignedBigInteger('department_id');
$table->unsignedBigInteger('faculty_id');
$table->dateTime('start_date');
$table->dateTime('end_date');
$table->integer('num_days');
$table->string('activity_type');
$table->string('category');
$table->string('level');
$table->string('proof')->nullable();
$table->foreign('faculty_id')->references('id')->on('users')->onDelete('cascade');
$table->foreign('department_id')->references('id')->on('departments')->onDelete('cascade');
$table->timestamps();
});
}
public function down()