Nav apraksta

2021_07_06_075356_criterion_scale.php 855B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. use Illuminate\Database\Schema\Blueprint;
  3. use Illuminate\Database\Migrations\Migration;
  4. class CriterionScale extends Migration
  5. {
  6. /**
  7. * Run the migrations.
  8. *
  9. * @return void
  10. */
  11. public function up()
  12. {
  13. Schema::create('criterion_scale', function (Blueprint $table) {
  14. $table->increments('id')->unsigned();
  15. $table->integer('criterion_id')->unsigned();
  16. $table->foreign('criterion_id')
  17. ->references('id')
  18. ->on('criteria')
  19. ->onUpdate('cascade')
  20. ->onDelete('cascade');
  21. $table->integer('scale_id')->unsigned();
  22. $table->foreign('scale_id')
  23. ->references('id')
  24. ->on('scales')
  25. ->onUpdate('cascade')
  26. ->onDelete('cascade');
  27. $table->integer('position')->unsigned();
  28. });
  29. }
  30. /**
  31. * Reverse the migrations.
  32. *
  33. * @return void
  34. */
  35. public function down()
  36. {
  37. Schema::drop('criterion_scale');
  38. }
  39. }