Skip to content

Commit f91b234

Browse files
fix: sql server migration
1 parent 5c07eb4 commit f91b234

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

database/migrations/2024_07_13_090447_create_fathers_table.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ public function up(): void
3333
$table->string('status')->storedAs("CASE WHEN active THEN 'Active' ELSE 'Inactive' END");
3434
}
3535

36-
// todo SQL Server persisted()
36+
if ((float) App::version() >= Constants::VERSION_AFTER_STORED_AS_VIRTUAL_AS_SUPPORT && DB::getDriverName() == 'sqlsrv') {
37+
$table->string('full_name')->persisted("CONCAT(first_name, ' ', last_name)");
38+
}
3739

3840
$table->timestamps(); // created_at, updated_at => ignored because they are nullable
3941
});

0 commit comments

Comments
 (0)