Ei kuvausta

2021_06_04_003810_create_activity_criterion_table.php 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. use Illuminate\Database\Schema\Blueprint;
  3. use Illuminate\Database\Migrations\Migration;
  4. class CreateActivityCriterionTable extends Migration
  5. {
  6. /**
  7. * Run the migrations.
  8. *
  9. * @return void
  10. */
  11. public function up()
  12. {
  13. Schema::create('activity_criterion', function (Blueprint $table) {
  14. $table->increments('id');
  15. $table->integer('activity_id')->unsigned();
  16. $table->integer('criterion_id')->unsigned();
  17. $table
  18. ->foreign('activity_id')
  19. ->references('id')
  20. ->on('activities')
  21. ->onDelete('cascade')
  22. ->onUpdate('cascade');
  23. $table
  24. ->foreign('criterion_id')
  25. ->references('id')
  26. ->on('criteria')
  27. ->onDelete('cascade')
  28. ->onUpdate('cascade');
  29. //$table->text('transformative_actions')->nullable();
  30. //$table->text('assessment_comments')->nullable();
  31. $table->decimal('weight', 6, 2)->default(1.0);
  32. $table->timestamps();
  33. });
  34. }
  35. /**
  36. * Reverse the migrations.
  37. *
  38. * @return void
  39. */
  40. public function down()
  41. {
  42. Schema::drop('activity_criterion');
  43. }
  44. }