No Description

2021_07_06_085513_template_titles.php 686B

1234567891011121314151617181920212223242526272829303132333435363738
  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->string('title');
  16. $table->integer('position');
  17. $table->integer('template_id')->unsigned();
  18. $table->foreign('template_id')
  19. ->references('id')
  20. ->on('templates')
  21. ->onDelete('cascade')
  22. ->onUpdate('cascade');
  23. });
  24. }
  25. /**
  26. * Reverse the migrations.
  27. *
  28. * @return void
  29. */
  30. public function down()
  31. {
  32. Schema::drop('template_title');
  33. }
  34. }