Skip to content

Commit d83c401

Browse files
committed
Fix revamp api_keys migration
1 parent f8ad720 commit d83c401

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

database/migrations/2024_11_04_185326_revamp_api_keys_permissions.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
public function up(): void
2323
{
2424
Schema::table('api_keys', function (Blueprint $table) {
25-
$table->json('permissions');
25+
$table->json('permissions')->default('[]');
2626
});
2727

2828
foreach (ApiKey::all() as $apiKey) {
@@ -72,7 +72,7 @@ public function down(): void
7272
$table->unsignedTinyInteger('r_mounts')->default(0);
7373
});
7474

75-
foreach (ApiKey::query() as $apiKey) {
75+
foreach (ApiKey::all() as $apiKey) {
7676
DB::table('api_keys')
7777
->where('id', $apiKey->id)
7878
->update([

0 commit comments

Comments
 (0)