No Description

2021_07_06_085513_template_titles.php 828B

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