added setting for user

This commit is contained in:
2026-08-16 22:00:23 +03:30
parent c3c3a60088
commit bd8284e4f8
11 changed files with 769 additions and 12 deletions
@@ -0,0 +1,60 @@
<?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
{
if (! Schema::hasTable('customer_special_price_packages')) {
Schema::create('customer_special_price_packages', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->unsignedBigInteger('profit_buy')->default(0);
$table->unsignedBigInteger('profit_sell')->default(0);
$table->boolean('show_product')->default(true);
$table->boolean('is_active')->default(true);
$table->timestamps();
});
}
if (! Schema::hasTable('customer_special_price_package_customer')) {
Schema::create('customer_special_price_package_customer', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('package_id');
$table->unsignedBigInteger('customer_id');
$table->unique(['package_id', 'customer_id'], 'cspp_customer_unique');
$table->index('customer_id', 'cspp_customer_id_idx');
});
}
if (! Schema::hasTable('customer_special_price_package_category')) {
Schema::create('customer_special_price_package_category', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('package_id');
$table->string('category_name');
$table->unique(['package_id', 'category_name'], 'cspp_category_unique');
});
}
if (! Schema::hasTable('customer_special_price_package_product')) {
Schema::create('customer_special_price_package_product', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('package_id');
$table->unsignedBigInteger('product_id');
$table->unique(['package_id', 'product_id'], 'cspp_product_unique');
$table->index('product_id', 'cspp_product_id_idx');
});
}
}
public function down(): void
{
Schema::dropIfExists('customer_special_price_package_product');
Schema::dropIfExists('customer_special_price_package_category');
Schema::dropIfExists('customer_special_price_package_customer');
Schema::dropIfExists('customer_special_price_packages');
}
};