Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

return new class extends Migration {
public function up(): void
{
$fields_to_update = [
'homeurl',
'cvsurl',
'bugtrackerurl',
'bugtrackernewissueurl',
'documentationurl',
'testingdataurl',
];

foreach ($fields_to_update as $field) {
DB::update("
UPDATE project
SET $field = 'https://' || $field
WHERE
$field NOT LIKE 'http://%'
AND $field NOT LIKE 'https://%'
AND $field IS NOT NULL
AND length($field) > 0
");
}
}

public function down(): void
{
}
};