mirror of https://github.com/4xmen/xshop.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.2 KiB
PHTML
40 lines
1.2 KiB
PHTML
5 months ago
|
<?php
|
||
|
|
||
|
use Illuminate\Database\Migrations\Migration;
|
||
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
use Illuminate\Support\Facades\Schema;
|
||
|
|
||
|
return new class extends Migration
|
||
|
{
|
||
|
/**
|
||
|
* Run the migrations.
|
||
|
*/
|
||
|
public function up(): void
|
||
|
{
|
||
3 months ago
|
Schema::create('orders', function (Blueprint $table) {
|
||
5 months ago
|
$table->id();
|
||
|
$table->unsignedBigInteger('invoice_id');
|
||
|
$table->unsignedBigInteger('product_id');
|
||
|
$table->unsignedBigInteger('quantity_id');
|
||
|
$table->integer('count')->nullable()->default(1);
|
||
|
$table->unsignedInteger('price_total');
|
||
|
$table->json('data')->nullable()->default(null);;
|
||
|
$table->timestamps();
|
||
|
|
||
|
$table->foreign('invoice_id')->references('id')
|
||
|
->on('invoices')->onDelete('cascade');
|
||
|
// $table->foreign('quantity_id')->references('id')->on('quantities')->onDelete('cascade');
|
||
|
$table->foreign('product_id')->references('id')
|
||
|
->on('products')->onDelete('cascade');
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
*/
|
||
|
public function down(): void
|
||
|
{
|
||
3 months ago
|
Schema::dropIfExists('orders');
|
||
5 months ago
|
}
|
||
|
};
|