2018_06_29_140403_create_order_pending.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateOrderPending extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. if (!Schema::hasTable('yz_order_pending')) {
  15. Schema::create('yz_order_pending', function(Blueprint $table) {
  16. $table->integer('id', true);
  17. $table->integer('order_id')->index('idx_order_id');
  18. $table->integer('model_id')->index('idx_model_id');
  19. $table->string('model_type');
  20. $table->string('note');
  21. $table->integer('created_at')->nullable();
  22. $table->integer('updated_at')->nullable();
  23. $table->integer('deleted_at')->nullable();
  24. });
  25. }
  26. }
  27. /**
  28. * Reverse the migrations.
  29. *
  30. * @return void
  31. */
  32. public function down()
  33. {
  34. if (Schema::hasTable('yz_order_pending')) {
  35. Schema::dropIfExists('yz_order_pending');
  36. }
  37. }
  38. }