2016_05_05_174022_create_exchanges_table.php 1010 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateExchangesTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('exchanges', function (Blueprint $table) {
  15. $table->increments('id');
  16. $table->integer('user_id')->unsigned()->index();
  17. $table->unsignedInteger('goods_id')->index();
  18. $table->unsignedInteger('coins')->default(0);
  19. $table->string('real_name',64);
  20. $table->string('phone',24);
  21. $table->string('email',128);
  22. $table->string('comment',512)->nullable();
  23. $table->unsignedTinyInteger('status')->default(0);
  24. $table->timestamps();
  25. });
  26. }
  27. /**
  28. * Reverse the migrations.
  29. *
  30. * @return void
  31. */
  32. public function down()
  33. {
  34. Schema::drop('exchanges');
  35. }
  36. }