schema condition in product flat table

This commit is contained in:
rahul shukla 2019-05-24 12:15:30 +05:30
parent 308b3be1d8
commit b8561d4d5e
1 changed files with 7 additions and 7 deletions

View File

@ -14,25 +14,25 @@ class AddRemainingColumnInProductFlatTable extends Migration
public function up()
{
Schema::table('product_flat', function (Blueprint $table) {
if (! Schema::hasColumn('short_description')) {
if (! Schema::hasColumn('product_flat', 'short_description')) {
$table->text('short_description')->nullable();
}
if (! Schema::hasColumn('meta_title')) {
if (! Schema::hasColumn('product_flat', 'meta_title')) {
$table->text('meta_title')->nullable();
}
if (! Schema::hasColumn('meta_keywords')) {
if (! Schema::hasColumn('product_flat', 'meta_keywords')) {
$table->text('meta_keywords')->nullable();
}
if (! Schema::hasColumn('meta_description')) {
if (! Schema::hasColumn('product_flat', 'meta_description')) {
$table->text('meta_description')->nullable();
}
if (! Schema::hasColumn('width')) {
if (! Schema::hasColumn('product_flat', 'width')) {
$table->decimal('width', 12, 4)->nullable();
}
if (! Schema::hasColumn('height')) {
if (! Schema::hasColumn('product_flat', 'height')) {
$table->decimal('height', 12, 4)->nullable();
}
if (! Schema::hasColumn('depth')) {
if (! Schema::hasColumn('product_flat', 'depth')) {
$table->decimal('depth', 12, 4)->nullable();
}
});