diff --git a/database/migrations/2026_07_26_000001_add_show_product_details_and_product_description.php b/database/migrations/2026_07_26_000001_add_show_product_details_and_product_description.php index 8d3b3ff..2217993 100644 --- a/database/migrations/2026_07_26_000001_add_show_product_details_and_product_description.php +++ b/database/migrations/2026_07_26_000001_add_show_product_details_and_product_description.php @@ -13,9 +13,14 @@ return new class extends Migration public function up(): void { if (Schema::hasTable('products') && ! Schema::hasColumn('products', 'description')) { - Schema::table('products', function ($table) { - $table->text('description')->nullable(); - }); + // charset صریح — روی سرورهای latin1-default، TEXT بدون charset فارسی را نمی‌پذیرد + DB::statement( + 'ALTER TABLE `products` ADD COLUMN `description` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL' + ); + } elseif (Schema::hasTable('products') && Schema::hasColumn('products', 'description')) { + DB::statement( + 'ALTER TABLE `products` MODIFY COLUMN `description` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL' + ); } if (! Schema::hasTable('settings')) { diff --git a/database/migrations/2026_07_29_000002_fix_products_description_charset.php b/database/migrations/2026_07_29_000002_fix_products_description_charset.php new file mode 100644 index 0000000..bf38b46 --- /dev/null +++ b/database/migrations/2026_07_29_000002_fix_products_description_charset.php @@ -0,0 +1,28 @@ +