2020_03_25_164834_change_commodities_table.php 815 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. use App\Commodity;
  3. use Illuminate\Support\Facades\Schema;
  4. use Illuminate\Database\Schema\Blueprint;
  5. use Illuminate\Database\Migrations\Migration;
  6. class ChangeCommoditiesTable extends Migration
  7. {
  8. /**
  9. * Run the migrations.
  10. *
  11. * 修改commodities表
  12. *
  13. * @return void
  14. */
  15. public function up()
  16. {
  17. Schema::table('commodities',function (Blueprint $table){
  18. $table->bigInteger('owner_id')->after('owner_name')->nullable()->comment('外键货主');
  19. });
  20. }
  21. /**
  22. * Reverse the migrations.
  23. *
  24. * @return void
  25. */
  26. public function down()
  27. {
  28. Schema::table('commodities',function (Blueprint $table){
  29. $table->string('owner_name')->after('owner_id')->nullable()->comment('外键货主');
  30. });
  31. }
  32. }