1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
-
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Database\Migrations\Migration;
-
- class ObjectiveProgramMigrate extends Migration
- {
-
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('objective_program', function (Blueprint $table) {
- $table->increments('id');
- $table->integer('program_id')->unsigned();
- $table->integer('objective_id')->unsigned();
-
-
- $table
- ->foreign('objective_id')
- ->references('id')
- ->on('objectives')
- ->onDelete('cascade')
- ->onUpdate('cascade');
- $table
- ->foreign('program_id')
- ->references('id')
- ->on('programs')
- ->onDelete('cascade')
- ->onUpdate('cascade');
- $table->timestamps();
- });
- }
-
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('objective_program');
- }
- }
|