설명 없음

2021_06_02_000507_create_rubrics_table.php 820B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. use Illuminate\Database\Schema\Blueprint;
  3. use Illuminate\Database\Migrations\Migration;
  4. class CreateRubricsTable extends Migration
  5. {
  6. public function up()
  7. {
  8. Schema::create('rubrics', function (Blueprint $table) {
  9. $table->increments('id');
  10. $table->string('name');
  11. $table->integer('expected_percentage');
  12. $table->integer('expected_points');
  13. $table->integer('user_id')->unsigned();
  14. $table->timestamps();
  15. $table->integer('num_scales')->unsigned();
  16. $table->integer('max_score')->unsigned();
  17. });
  18. Schema::table('rubrics', function (Blueprint $table) {
  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('rubrics');
  30. }
  31. }