Nenhuma descrição

2021_06_01_235626_create_criteria_table.php 842B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. use Illuminate\Database\Schema\Blueprint;
  3. use Illuminate\Database\Migrations\Migration;
  4. class CreateCriteriaTable extends Migration
  5. {
  6. public function up()
  7. {
  8. Schema::create('criteria', function (Blueprint $table) {
  9. $table->increments('id');
  10. $table->string('name', 400);
  11. $table->text('subcriteria')->nullable();
  12. $table->integer('user_id')->unsigned()->nullable();
  13. $table->text('copyright')->nullable();
  14. $table->text('notes')->nullable();
  15. $table->integer('num_scales');
  16. $table->integer('max_score');
  17. $table->timestamps();
  18. $table->timestamp('deleted_at')->nullable();
  19. $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade')->onUpdate('cascade');
  20. });
  21. }
  22. /**
  23. * Reverse the migrations.
  24. *
  25. * @return void
  26. */
  27. public function down()
  28. {
  29. Schema::drop('criteria');
  30. }
  31. }