|
|
@@ -0,0 +1,40 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+use Illuminate\Database\Migrations\Migration;
|
|
|
+use Illuminate\Database\Schema\Blueprint;
|
|
|
+use Illuminate\Support\Facades\Schema;
|
|
|
+
|
|
|
+return new class extends Migration
|
|
|
+{
|
|
|
+ /**
|
|
|
+ * Run the migrations.
|
|
|
+ * Остатки продукта, каждый продукт уникален, то есть если добавили в заказ 5 одинаковых лавок,
|
|
|
+ * то здесь создаётся 5 записей и привязываются к заказу
|
|
|
+ */
|
|
|
+ public function up(): void
|
|
|
+ {
|
|
|
+ Schema::create('products_sku', function (Blueprint $table) {
|
|
|
+ $table->id();
|
|
|
+ $table->foreignId('product_id')->constrained('products')->restrictOnDelete();
|
|
|
+ $table->string('status'); // ordered, stock, shipped
|
|
|
+ $table->string('rfid');
|
|
|
+ $table->string('factory_number');
|
|
|
+ $table->date('manufacture_date');
|
|
|
+ $table->unsignedInteger('service_life'); //срок эксплуатации
|
|
|
+ $table->string('certificate_number');
|
|
|
+ $table->date('certificate_date');
|
|
|
+ $table->string('certificate_issuer');
|
|
|
+
|
|
|
+ $table->softDeletes();
|
|
|
+ $table->timestamps();
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Reverse the migrations.
|
|
|
+ */
|
|
|
+ public function down(): void
|
|
|
+ {
|
|
|
+ Schema::dropIfExists('products_sku');
|
|
|
+ }
|
|
|
+};
|