2017_10_12_14509_create_user_template_table.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. /**
  6. * Migration auto-generated by Sequel Pro Laravel Export
  7. * @see https://github.com/cviebrock/sequel-pro-laravel-export
  8. */
  9. class CreateUserTemplateTable extends Migration
  10. {
  11. /**
  12. * Run the migrations.
  13. *
  14. * @return void
  15. */
  16. public function up()
  17. {
  18. Schema::create('user_template', function (Blueprint $table) {
  19. $table->increments('id');
  20. $table->integer('user_id')->comment('用户id');
  21. $table->string('app_id')->comment('app_id')->default(0);
  22. $table->integer('template_id')->comment('模板id');
  23. $table->nullableTimestamps();
  24. $table->index('template_id', 'user_template_template_id_foreign');
  25. $table->index('app_id', 'user_template_app_id_foreign');
  26. });
  27. }
  28. /**
  29. * Reverse the migrations.
  30. *
  31. * @return void
  32. */
  33. public function down()
  34. {
  35. Schema::dropIfExists('user_template');
  36. }
  37. }