2016_03_13_151917_create_annotation_table.php 1016 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. use Illuminate\Database\Schema\Blueprint;
  3. use Illuminate\Database\Migrations\Migration;
  4. class CreateAnnotationTable extends Migration
  5. {
  6. /**
  7. * Run the migrations.
  8. *
  9. * @return void
  10. */
  11. public function up()
  12. {
  13. Schema::create('annotations', function (Blueprint $table) {
  14. $table->increments('id');
  15. $table->integer('confidence_score');
  16. $table->integer('user_id')->unsigned()->nullable();
  17. $table->integer('word_id')->unsigned()->nullable();
  18. $table->integer('postag_id')->unsigned()->nullable();
  19. $table->foreign('user_id')->references('id')->on('users');
  20. $table->foreign('word_id')->references('id')->on('words');
  21. $table->foreign('postag_id')->references('id')->on('postags');
  22. $table->timestamps();
  23. });
  24. }
  25. /**
  26. * Reverse the migrations.
  27. *
  28. * @return void
  29. */
  30. public function down()
  31. {
  32. Schema::drop('annotations');
  33. }
  34. }