File: /home/imensosw/.trash/database.2/migrations/2022_02_28_000005_create_opportunities_table.php
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateOpportunitiesTable extends Migration
{
public function up()
{
Schema::create('opportunities', function (Blueprint $table) {
$table->increments('id');
$table->integer('partner_id')->unsigned();
$table->string('opportunity_title');
$table->string('slug')->nullable();
$table->longText('opportunity_desc')->nullable();
$table->string('feature_image')->nullable();
$table->double('opportunity_hours')->nullable();
$table->integer('no_of_volunteers')->nullable();
$table->date('start_date')->nullable();
$table->time('start_time')->nullable();
$table->time('end_time')->nullable();
$table->text('address_location')->nullable();
$table->text('address_location_detail')->nullable();
$table->string('address_line1')->nullable();
$table->string('address_city')->nullable();
$table->string('address_state')->nullable();
$table->string('address_country')->nullable();
$table->string('address_postcode')->nullable();
$table->string('address_lat')->nullable();
$table->string('address_long')->nullable();
$table->integer('opportunity_status')->nullable()->default(0);
$table->timestamps();
$table->softDeletes();
});
Schema::table('opportunities', function($table) {
$table->foreign('partner_id')->references('id')->on('users');
});
}
}