hasPlugin('RainLab.Blog')) { Schema::table('rainlab_blog_posts', function ($table) { if (!Schema::hasColumn('rainlab_blog_posts', 'powerseo_title')) { $table->text('powerseo_title')->nullable(); } if (!Schema::hasColumn('rainlab_blog_posts', 'powerseo_description')) { $table->text('powerseo_description')->nullable(); } if (!Schema::hasColumn('rainlab_blog_posts', 'powerseo_keywords')) { $table->text('powerseo_keywords')->nullable(); } // if (!Schema::hasColumn('rainlab_blog_posts', 'powerseo_canonical_url')) { // $table->text('powerseo_canonical_url')->nullable(); // } // if (!Schema::hasColumn('rainlab_blog_posts', 'powerseo_redirect_url')) { // $table->text('powerseo_redirect_url')->nullable(); // } if (!Schema::hasColumn('rainlab_blog_posts', 'powerseo_robot_index')) { $table->string('powerseo_robot_index')->nullable(); } if (!Schema::hasColumn('rainlab_blog_posts', 'powerseo_robot_follow')) { $table->string('powerseo_robot_follow')->nullable(); } }); } } public function down() { if (PluginManager::instance()->hasPlugin('RainLab.Blog')) { Schema::table('rainlab_blog_posts', function ($table) { $table->dropColumn('powerseo_title'); $table->dropColumn('powerseo_description'); $table->dropColumn('powerseo_keywords'); // $table->dropColumn('powerseo_canonical_url'); // $table->dropColumn('powerseo_redirect_url'); $table->dropColumn('powerseo_robot_index'); $table->dropColumn('powerseo_robot_follow'); }); } } }