|
@@ -0,0 +1,36 @@
|
|
|
|
|
+<?php
|
|
|
|
|
+
|
|
|
|
|
+use Illuminate\Database\Migrations\Migration;
|
|
|
|
|
+use Illuminate\Database\Schema\Blueprint;
|
|
|
|
|
+use Illuminate\Support\Facades\Schema;
|
|
|
|
|
+
|
|
|
|
|
+return new class extends Migration
|
|
|
|
|
+{
|
|
|
|
|
+ public function up(): void
|
|
|
|
|
+ {
|
|
|
|
|
+ Schema::table('products', function (Blueprint $table) {
|
|
|
|
|
+ $table->text('description')->nullable()->after('name');
|
|
|
|
|
+ $table->string('sku')->nullable()->change();
|
|
|
|
|
+ $table->string('barcode')->nullable()->change();
|
|
|
|
|
+ $table->string('measure_unit')->nullable()->change();
|
|
|
|
|
+ $table->decimal('price_cost', 10, 2)->nullable()->change();
|
|
|
|
|
+ $table->decimal('weight', 10, 3)->nullable()->change();
|
|
|
|
|
+ $table->decimal('length', 10, 3)->nullable()->change();
|
|
|
|
|
+ $table->decimal('height', 10, 3)->nullable()->change();
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function down(): void
|
|
|
|
|
+ {
|
|
|
|
|
+ Schema::table('products', function (Blueprint $table) {
|
|
|
|
|
+ $table->dropColumn('description');
|
|
|
|
|
+ $table->string('sku')->nullable(false)->change();
|
|
|
|
|
+ $table->string('barcode')->nullable(false)->change();
|
|
|
|
|
+ $table->string('measure_unit')->nullable(false)->change();
|
|
|
|
|
+ $table->decimal('price_cost', 10, 2)->nullable(false)->change();
|
|
|
|
|
+ $table->decimal('weight', 10, 3)->nullable(false)->change();
|
|
|
|
|
+ $table->decimal('length', 10, 3)->nullable(false)->change();
|
|
|
|
|
+ $table->decimal('height', 10, 3)->nullable(false)->change();
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+};
|