April 2026 waren Wirtschaft Feedback
This commit is contained in:
parent
02f2a4c23e
commit
9ce711d6b2
167 changed files with 25278 additions and 8518 deletions
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateCountriesTable extends Migration
|
||||
{
|
||||
|
|
@ -35,14 +35,11 @@ class CreateCountriesTable extends Migration
|
|||
$table->boolean('currency_calc')->default(false);
|
||||
$table->decimal('currency_faktor', 4, 2)->nullable();
|
||||
|
||||
$table->boolean('active')->default(true);
|
||||
$table->text('trans_name')->nullable();
|
||||
$table->text('attr')->nullable();
|
||||
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAttributesTable extends Migration
|
||||
{
|
||||
|
|
@ -25,16 +25,13 @@ class CreateAttributesTable extends Migration
|
|||
|
||||
$table->string('slug')->unique()->index();
|
||||
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('parent_id')
|
||||
->references('id')
|
||||
->on('attributes');
|
||||
|
||||
$table->foreign('attribute_type_id')
|
||||
->references('id')
|
||||
->on('attribute_types');
|
||||
// FK zu attribute_types wird in create_attribute_types_table Migration gesetzt (Reihenfolge-Problem)
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateProductAttributesTable extends Migration
|
||||
{
|
||||
|
|
@ -32,10 +32,7 @@ class CreateProductAttributesTable extends Migration
|
|||
->on('attributes')
|
||||
->onDelete('cascade');
|
||||
|
||||
$table->foreign('type_id')
|
||||
->references('id')
|
||||
->on('attribute_types')
|
||||
->onDelete('cascade');
|
||||
// FK zu attribute_types wird in create_attribute_types_table Migration gesetzt (Reihenfolge-Problem)
|
||||
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateProductImagesTable extends Migration
|
||||
{
|
||||
|
|
@ -29,7 +29,7 @@ class CreateProductImagesTable extends Migration
|
|||
$table->string('slug')->unique()->index();
|
||||
$table->unsignedTinyInteger('pos')->nullable()->default(0);
|
||||
$table->text('attributes')->nullable();
|
||||
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('product_id')
|
||||
|
|
@ -37,10 +37,7 @@ class CreateProductImagesTable extends Migration
|
|||
->on('products')
|
||||
->onDelete('cascade');
|
||||
|
||||
$table->foreign('user_wl_product_id')
|
||||
->references('id')
|
||||
->on('user_whitelabel_products')
|
||||
->onDelete('cascade');
|
||||
// FK zu user_whitelabel_products wird in create_user_whitelabel_products_table Migration gesetzt (Reihenfolge-Problem)
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,12 +22,12 @@ class CreateProductBuysTable extends Migration
|
|||
$table->timestamps();
|
||||
|
||||
$table->foreign('product_id')
|
||||
->references('id')
|
||||
->on('products');
|
||||
->references('id')
|
||||
->on('products');
|
||||
|
||||
$table->foreign('user_id')
|
||||
->references('id')
|
||||
->on('users');
|
||||
$table->foreign('auth_user_id')
|
||||
->references('id')
|
||||
->on('users');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,14 +25,24 @@ class CreateAttributeTypesTable extends Migration
|
|||
|
||||
$table->string('slug')->unique()->index();
|
||||
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('parent_id')
|
||||
->references('id')
|
||||
->on('attributes');
|
||||
});
|
||||
|
||||
|
||||
Schema::table('attributes', function (Blueprint $table) {
|
||||
$table->foreign('attribute_type_id')
|
||||
->references('id')
|
||||
->on('attribute_types');
|
||||
});
|
||||
|
||||
Schema::table('product_attributes', function (Blueprint $table) {
|
||||
$table->foreign('type_id')
|
||||
->references('id')
|
||||
->on('attribute_types')
|
||||
->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -43,6 +53,14 @@ class CreateAttributeTypesTable extends Migration
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('product_attributes', function (Blueprint $table) {
|
||||
$table->dropForeign(['type_id']);
|
||||
});
|
||||
|
||||
Schema::table('attributes', function (Blueprint $table) {
|
||||
$table->dropForeign(['attribute_type_id']);
|
||||
});
|
||||
|
||||
Schema::dropIfExists('attribute_types');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,13 @@ class CreateUserWhitelabelProductsTable extends Migration
|
|||
->on('products')
|
||||
->onDelete('cascade');
|
||||
});
|
||||
|
||||
Schema::table('product_images', function (Blueprint $table) {
|
||||
$table->foreign('user_wl_product_id')
|
||||
->references('id')
|
||||
->on('user_whitelabel_products')
|
||||
->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -45,6 +52,10 @@ class CreateUserWhitelabelProductsTable extends Migration
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('product_images', function (Blueprint $table) {
|
||||
$table->dropForeign(['user_wl_product_id']);
|
||||
});
|
||||
|
||||
Schema::dropIfExists('user_whitelabel_products');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
<?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
|
||||
{
|
||||
Schema::table('shopping_orders', function (Blueprint $table) {
|
||||
$table->text('cancellation_invoice')->nullable()->after('invoice');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('shopping_orders', function (Blueprint $table) {
|
||||
$table->dropColumn('cancellation_invoice');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<?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
|
||||
{
|
||||
Schema::table('product_ingredients', function (Blueprint $table) {
|
||||
$table->unsignedSmallInteger('pos')->default(0)->after('ingredient_id');
|
||||
$table->decimal('gram', 12, 2)->nullable()->after('pos');
|
||||
$table->decimal('factor', 4, 2)->default(1.10)->after('gram');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('product_ingredients', function (Blueprint $table) {
|
||||
$table->dropColumn(['pos', 'gram', 'factor']);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<?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
|
||||
{
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
$table->enum('shelf_life_type', ['pao', 'fixed'])->nullable()->after('max_buy_num');
|
||||
$table->unsignedTinyInteger('shelf_life_months')->nullable()->after('shelf_life_type');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
$table->dropColumn(['shelf_life_type', 'shelf_life_months']);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<?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
|
||||
{
|
||||
Schema::table('ingredients', function (Blueprint $table) {
|
||||
$table->decimal('default_factor', 4, 2)->default(1.10)->after('pos');
|
||||
$table->decimal('min_stock_alert', 12, 2)->nullable()->after('default_factor');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('ingredients', function (Blueprint $table) {
|
||||
$table->dropColumn(['default_factor', 'min_stock_alert']);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?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::create('locations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->boolean('active')->default(true);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('locations');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?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::create('supplier_categories', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->unsignedTinyInteger('pos')->default(0);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('supplier_categories');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<?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::create('suppliers', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('url')->nullable();
|
||||
$table->string('contact_person')->nullable();
|
||||
$table->string('email')->nullable();
|
||||
$table->string('phone', 100)->nullable();
|
||||
$table->unsignedInteger('country_id');
|
||||
$table->text('notes')->nullable();
|
||||
$table->boolean('active')->default(true);
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->foreign('country_id')->references('id')->on('countries');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('suppliers');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<?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::create('supplier_supplier_category', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('supplier_id')->constrained('suppliers')->cascadeOnDelete();
|
||||
$table->foreignId('supplier_category_id')->constrained('supplier_categories')->cascadeOnDelete();
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique(['supplier_id', 'supplier_category_id'], 'supplier_supplier_cat_unique');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('supplier_supplier_category');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?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::create('material_qualities', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->unsignedTinyInteger('pos')->default(0);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('material_qualities');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?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::create('packaging_materials', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->unsignedTinyInteger('pos')->default(0);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('packaging_materials');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<?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::create('packaging_items', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('packaging_material_id')->constrained('packaging_materials');
|
||||
$table->foreignId('supplier_id')->nullable()->constrained('suppliers')->nullOnDelete();
|
||||
$table->string('name');
|
||||
$table->enum('category', ['packaging', 'label', 'shipping_office']);
|
||||
$table->decimal('weight_grams', 10, 2)->default(0);
|
||||
$table->unsignedInteger('min_stock_alert')->nullable();
|
||||
$table->unsignedInteger('product_id')->nullable();
|
||||
$table->foreign('product_id')->references('id')->on('products')->nullOnDelete();
|
||||
$table->boolean('active')->default(true);
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('packaging_items');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
<?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::create('stock_entries', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->enum('entry_type', ['ingredient', 'packaging', 'label', 'shipping_office']);
|
||||
$table->unsignedInteger('ingredient_id')->nullable();
|
||||
$table->foreign('ingredient_id')->references('id')->on('ingredients')->nullOnDelete();
|
||||
$table->foreignId('packaging_item_id')->nullable()->constrained('packaging_items')->nullOnDelete();
|
||||
$table->foreignId('supplier_id')->constrained('suppliers');
|
||||
$table->foreignId('location_id')->constrained('locations');
|
||||
$table->enum('unit', ['gram', 'piece']);
|
||||
|
||||
$table->unsignedInteger('ordered_by');
|
||||
$table->foreign('ordered_by')->references('id')->on('users');
|
||||
$table->date('ordered_at');
|
||||
$table->decimal('ordered_quantity', 12, 2);
|
||||
$table->decimal('price_per_kg', 10, 4)->nullable();
|
||||
$table->decimal('price_total', 10, 4)->nullable();
|
||||
|
||||
$table->unsignedInteger('received_by')->nullable();
|
||||
$table->foreign('received_by')->references('id')->on('users')->nullOnDelete();
|
||||
$table->date('received_at')->nullable();
|
||||
$table->decimal('received_quantity', 12, 2)->nullable();
|
||||
$table->string('batch_number', 100)->nullable();
|
||||
$table->date('best_before')->nullable();
|
||||
$table->foreignId('quality_id')->nullable()->constrained('material_qualities')->nullOnDelete();
|
||||
|
||||
$table->enum('status', ['pending', 'received'])->default('pending');
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['status', 'ordered_at']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('stock_entries');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('product_packagings', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedInteger('product_id');
|
||||
$table->foreign('product_id')->references('id')->on('products')->cascadeOnDelete();
|
||||
$table->foreignId('packaging_item_id')->constrained('packaging_items')->cascadeOnDelete();
|
||||
$table->decimal('quantity', 12, 2)->default(1);
|
||||
$table->unsignedSmallInteger('pos')->default(0);
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique(['product_id', 'packaging_item_id']);
|
||||
});
|
||||
|
||||
if (Schema::hasTable('packaging_items')) {
|
||||
$rows = DB::table('packaging_items')
|
||||
->whereNotNull('product_id')
|
||||
->orderBy('id')
|
||||
->get(['id', 'product_id']);
|
||||
|
||||
foreach ($rows as $row) {
|
||||
DB::table('product_packagings')->insert([
|
||||
'product_id' => $row->product_id,
|
||||
'packaging_item_id' => $row->id,
|
||||
'quantity' => 1,
|
||||
'pos' => 0,
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('product_packagings');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
<?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::create('productions', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedInteger('product_id');
|
||||
$table->foreign('product_id')->references('id')->on('products')->cascadeOnDelete();
|
||||
$table->foreignId('location_id')->constrained('locations');
|
||||
$table->unsignedInteger('produced_by');
|
||||
$table->foreign('produced_by')->references('id')->on('users');
|
||||
$table->date('produced_at');
|
||||
$table->unsignedInteger('quantity');
|
||||
$table->text('notes')->nullable();
|
||||
$table->boolean('mhd_warning')->default(false);
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['produced_at', 'location_id']);
|
||||
});
|
||||
|
||||
Schema::create('production_ingredients', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('production_id')->constrained('productions')->cascadeOnDelete();
|
||||
$table->unsignedInteger('ingredient_id');
|
||||
$table->foreign('ingredient_id')->references('id')->on('ingredients');
|
||||
$table->foreignId('stock_entry_id')->constrained('stock_entries');
|
||||
$table->decimal('quantity_used', 12, 2);
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['production_id', 'ingredient_id']);
|
||||
});
|
||||
|
||||
Schema::create('production_packagings', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('production_id')->constrained('productions')->cascadeOnDelete();
|
||||
$table->foreignId('packaging_item_id')->constrained('packaging_items');
|
||||
$table->unsignedInteger('quantity_used');
|
||||
$table->timestamps();
|
||||
|
||||
$table->index('production_id');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('production_packagings');
|
||||
Schema::dropIfExists('production_ingredients');
|
||||
Schema::dropIfExists('productions');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<?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('packaging_items', function (Blueprint $table) {
|
||||
$table->string('url', 500)->nullable()->after('min_stock_alert');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('packaging_items', function (Blueprint $table) {
|
||||
$table->dropColumn('url');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<?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('ingredients', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('material_quality_id')->nullable()->after('min_stock_alert');
|
||||
$table->foreign('material_quality_id')->references('id')->on('material_qualities')->nullOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('ingredients', function (Blueprint $table) {
|
||||
$table->dropForeign(['material_quality_id']);
|
||||
$table->dropColumn('material_quality_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<?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('product_ingredients', function (Blueprint $table) {
|
||||
$table->string('recipe_type', 20)->default('product')->after('factor');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('product_ingredients', function (Blueprint $table) {
|
||||
$table->dropColumn('recipe_type');
|
||||
});
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue