Skip to content

Commit a843ab3

Browse files
authored
Fix cache persistence of views (#3940)
1 parent a743438 commit a843ab3

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

database/migrations/2025_12_18_101617_preserve_size_variants_for_orders.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@
2828
public function up(): void
2929
{
3030
// Step 1: Drop the existing foreign key constraint on size_variants.photo_id
31-
Schema::table('size_variants', function (Blueprint $table) {
32-
$table->dropForeign(['photo_id']);
33-
});
31+
try {
32+
Schema::table('size_variants', function (Blueprint $table) {
33+
$table->dropForeign(['photo_id']);
34+
});
35+
} catch (\Exception $e) {
36+
// If the foreign key does not exist, we can safely ignore the error
37+
}
3438

3539
// Step 2: Make photo_id nullable in size_variants
3640
Schema::table('size_variants', function (Blueprint $table) {

docker/scripts/entrypoint.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ web)
103103
echo "🧹 Optimizing application..."
104104
php artisan config:clear
105105
php artisan config:cache
106+
php artisan route:clear
106107
php artisan route:cache
108+
php artisan view:clear
107109
php artisan view:cache
108110

109111
echo "✅ Application ready!"

0 commit comments

Comments
 (0)