    <?php

    use Illuminate\Database\Migrations\Migration;
    use Illuminate\Database\Schema\Blueprint;
    use Illuminate\Support\Facades\Schema;

    class CreateKegiatansTable extends Migration
    {
        /**
         * Run the migrations.
         *
         * @return void
         */
        public function up()
    {
        Schema::create('kegiatans', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('instansi_id');
            $table->unsignedBigInteger('user_id'); // Si pembuat
            $table->string('nama_kegiatan');
            $table->date('tanggal');
            $table->text('deskripsi');
            $table->string('foto')->nullable();
            $table->timestamps();

            $table->foreign('instansi_id')->references('id')->on('instansis');
            $table->foreign('user_id')->references('id')->on('users');
        });
    }

        /**
         * Reverse the migrations.
         *
         * @return void
         */
        public function down()
        {
            Schema::dropIfExists('kegiatans');
        }
    }
