diff --git a/database/migrations/2024_09_16_170001_populate_ssh_keys_directory.php b/database/migrations/2024_09_16_170001_populate_ssh_keys_and_clear_mux_directory.php similarity index 71% rename from database/migrations/2024_09_16_170001_populate_ssh_keys_directory.php rename to database/migrations/2024_09_16_170001_populate_ssh_keys_and_clear_mux_directory.php index 33a5e695f..944b00e13 100644 --- a/database/migrations/2024_09_16_170001_populate_ssh_keys_directory.php +++ b/database/migrations/2024_09_16_170001_populate_ssh_keys_and_clear_mux_directory.php @@ -4,13 +4,16 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\Storage; use App\Models\PrivateKey; -class PopulateSshKeysDirectory extends Migration +class PopulateSshKeysAndClearMuxDirectory extends Migration { public function up() { Storage::disk('ssh-keys')->deleteDirectory(''); Storage::disk('ssh-keys')->makeDirectory(''); + Storage::disk('ssh-mux')->deleteDirectory(''); + Storage::disk('ssh-mux')->makeDirectory(''); + PrivateKey::chunk(100, function ($keys) { foreach ($keys as $key) { $key->storeInFileSystem();