123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
-
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Database\Migrations\Migration;
-
- class CreateOutcomePerformanceTable extends Migration {
-
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('outcome_performance', function(Blueprint $table)
- {
- $table->increments('id');
- $table->integer('criterion_id')->unsigned();
- $table->integer('outcome_id')->unsigned();
- $table->integer('semester_id')->unsigned();
- $table->integer('students_attempted');
- $table->integer('students_achieved');
- $table->smallInteger('level');
- $table
- ->foreign('criterion_id')
- ->references('id')
- ->on('criteria')
- ->onDelete('cascade')
- ->onUpdate('cascade');
- $table
- ->foreign('outcome_id')
- ->references('id')
- ->on('outcomes')
- ->onDelete('cascade')
- ->onUpdate('cascade');
- $table
- ->foreign('semester_id')
- ->references('id')
- ->on('semesters')
- ->onDelete('cascade')
- ->onUpdate('cascade');
-
- $table->timestamps();
- });
- }
-
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('outcome_performance');
- }
-
- }
|