File: /home/imensosw/.trash/database.2/migrations/2022_03_07_000006_create_volunteer_hours_table.php
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateVolunteerHoursTable extends Migration
{
public function up()
{
Schema::create('volunteer_hours', function (Blueprint $table) {
$table->increments('id');
$table->integer('volunteer_id')->unsigned();
$table->integer('opportunity_id')->unsigned();
$table->integer('event_id')->unsigned();
$table->integer('work_status')->default(0);
$table->integer('work_hours')->default(0);
$table->integer('work_docs')->default(0);
$table->timestamps();
$table->softDeletes();
});
Schema::table('volunteer_hours', function($table) {
$table->foreign('volunteer_id')->references('id')->on('users');
$table->foreign('opportunity_id')->references('id')->on('opportunities');
$table->foreign('event_id')->references('id')->on('live_events');
});
}
}