Skip to content

Commit 87f7a5a

Browse files
simonhampclaude
andcommitted
Guard is_comped column addition with existence check
Prevents deploy failure when the column already exists from a previously run (now deleted) duplicate migration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent df0e158 commit 87f7a5a

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

database/migrations/2026_03_20_210435_add_is_comped_to_product_licenses_and_update_sales_view.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
{
1010
public function up(): void
1111
{
12-
Schema::table('product_licenses', function (Blueprint $table) {
13-
$table->boolean('is_comped')->default(false)->after('currency')->index();
14-
});
12+
if (! Schema::hasColumn('product_licenses', 'is_comped')) {
13+
Schema::table('product_licenses', function (Blueprint $table) {
14+
$table->boolean('is_comped')->default(false)->after('currency')->index();
15+
});
16+
}
1517

1618
DB::statement('DROP VIEW IF EXISTS sales_view');
1719

0 commit comments

Comments
 (0)