2018_04_07_153109_create_company_table.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateCompanyTable extends Migration
  6. {
  7. protected $table = 'company';
  8. /**
  9. * Run the migrations.
  10. *
  11. * @return void
  12. */
  13. public function up()
  14. {
  15. Schema::create($this->table, function (Blueprint $table) {
  16. $table->increments('id')->comment('唯一标识')->unsigned();
  17. $table->string('ename', 20)->comment('英文简写,方便后端读取');
  18. $table->string('name', 50)->comment('中文名称,用于后台显示');
  19. $table->string('value', 50)->comment('值');
  20. $table->string('image')->comment('图片相对路径')->nullable();
  21. $table->timestamps();
  22. });
  23. DB::statement("ALTER TABLE ".$this->table." comment'公司信息表'");
  24. }
  25. /**
  26. * Reverse the migrations.
  27. *
  28. * @return void
  29. */
  30. public function down()
  31. {
  32. Schema::dropIfExists($this->table);
  33. }
  34. }