Skip to content

Commit 26995ae

Browse files
authored
Fix migration failing when rerun. (#4070)
1 parent d213e75 commit 26995ae

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

database/migrations/2026_01_18_212133_refactor_photo_structure.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@
1919
*/
2020
public function up(): void
2121
{
22-
Schema::table('photos', function (Blueprint $table) {
23-
$table->string('duration')->nullable()->after('focal');
24-
$table->string('fps')->nullable()->after('duration');
25-
});
22+
if (!Schema::hasColumn('photos', 'duration')) {
23+
Schema::table('photos', function (Blueprint $table) {
24+
$table->string('duration')->nullable()->after('focal');
25+
$table->string('fps')->nullable()->after('duration');
26+
});
27+
}
2628

2729
DB::transaction(function () {
2830
DB::table('photos')->select('id', 'aperture', 'focal')

0 commit comments

Comments
 (0)