id(); $table->string('name')->comment('名称'); $table->string('key')->unique()->comment('key'); $table->unsignedInteger('width')->nullable()->comment('宽'); $table->unsignedInteger('height')->nullable()->comment('高'); $table->unsignedTinyInteger('is_enable')->default(1)->comment('可用状态'); $table->string('remarks')->nullable()->comment('备注'); $table->timestamps(); }); } if (!Schema::hasTable('banners')) { Schema::create('banners', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('ad_id')->comment('位置ID'); $table->string('path')->comment('地址'); $table->string('name')->nullable()->comment('名称'); $table->unsignedInteger('sort')->comment('排序'); $table->unsignedTinyInteger('is_enable')->default(1)->comment('可用状态'); $table->text('ext')->nullable()->comment('扩展字段,可用于跳转配置等'); $table->string('remarks')->nullable()->comment('备注'); $table->timestamps(); }); } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('banners'); Schema::dropIfExists('banner_ads'); } };