2021_02_05_122049_sys_assemble_column.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. return new class extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('sys_assemble_column', function (Blueprint $table) {
  15. $table->id('id')->unsigned()->comment('编号');
  16. $table->string('mid', 16)->comment('唯一标识符'); // 随机
  17. $table->bigInteger('assemble_id')->comment('集合id');
  18. $table->string('title', 255)->comment('标题,中文注释'); // 中文注释
  19. $table->string('code', 255)->comment('字段名称,英文');
  20. $table->string('type', 255)->comment('字段类型');
  21. $table->integer('length')->nullable()->comment('字段长度');
  22. $table->integer('decimal')->nullable()->comment('浮点数精度');
  23. $table->tinyInteger('is_null')->nullable()->default(0)->comment('是否可以为空 1是 0否');
  24. $table->tinyInteger('is_unsigned')->nullable()->default(0)->comment('是否为无符号类型 1是 0否');
  25. $table->string('default', 500)->nullable()->default('')->comment('默认值');
  26. $table->string('remark', 500)->nullable()->comment('备注'); // 备注
  27. $table->decimal('weight')->unsigned()->nullable()->default(0)->comment('权重,用于排序');
  28. $table->tinyInteger('is_delete')->unsigned()->default(0)->comment('是否删除 1是');
  29. $table->bigInteger('created_at', false)->unsigned()->comment('创建时间,时间戳');
  30. $table->bigInteger('updated_at', false)->unsigned()->comment('更新时间,时间戳');
  31. });
  32. }
  33. /**
  34. * Reverse the migrations.
  35. *
  36. * @return void
  37. */
  38. public function down()
  39. {
  40. Schema::dropIfExists('sys_assemble_column');
  41. }
  42. };