¨4.0.1¨
This commit is contained in:
@@ -52,6 +52,7 @@ class CreateOrdersTable extends Migration
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
|
||||
@@ -26,6 +26,7 @@ class CreateOrderProductsTable extends Migration
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
|
||||
@@ -24,6 +24,7 @@ class CreateOrderProductOptionsTable extends Migration
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
|
||||
@@ -24,6 +24,7 @@ class CreateOrderProductOptionValuesTable extends Migration
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
|
||||
@@ -24,6 +24,7 @@ class CreateOrderTaxesTable extends Migration
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
|
||||
@@ -18,6 +18,7 @@ class AddValueColumnToOrderProductOptionsTable extends Migration
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
|
||||
@@ -18,6 +18,7 @@ class AddNoteColumnToOrdersTable extends Migration
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
|
||||
@@ -15,6 +15,7 @@ class ChangeShippingMethodColumnInOrdersTable extends Migration
|
||||
DB::statement('ALTER TABLE orders MODIFY shipping_method VARCHAR(191)');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
|
||||
@@ -23,6 +23,7 @@ class CreateOrderDownloadsTable extends Migration
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateOrderProductVariationsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('order_product_variations', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('order_product_id')->unsigned();
|
||||
$table->integer('variation_id')->unsigned();
|
||||
$table->string('type');
|
||||
$table->string('value');
|
||||
|
||||
$table->unique(['order_product_id', 'variation_id']);
|
||||
$table->foreign('order_product_id')->references('id')->on('order_products')->onDelete('cascade');
|
||||
$table->foreign('variation_id')->references('id')->on('variations')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('order_product_variations');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateOrderProductVariationValuesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('order_product_variation_values', function (Blueprint $table) {
|
||||
$table->integer('order_product_variation_id')->unsigned();
|
||||
$table->integer('variation_value_id')->unsigned();
|
||||
|
||||
$table->primary(['order_product_variation_id', 'variation_value_id'], 'order_product_variation_id_variation_value_id_primary');
|
||||
|
||||
$table->foreign('order_product_variation_id', 'order_product_variation_values_order_product_variation_id')->references('id')->on('order_product_variations')->onDelete('cascade');
|
||||
$table->foreign('variation_value_id')->references('id')->on('variation_values')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('order_product_variation_values');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddProductVariantIdColumnToOrderProductsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('order_products', function (Blueprint $table) {
|
||||
$table->foreignId('product_variant_id')->nullable()->after('product_id');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('order_products', function (Blueprint $table) {
|
||||
$table->dropColumn('product_variant_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user