mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 00:34:44 +02:00
Fix revamp api_keys migration (#987)
This commit is contained in:
parent
6bc55b1039
commit
98c36c4cc3
@ -18,8 +18,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|||||||
* @property int $key_type
|
* @property int $key_type
|
||||||
* @property string $identifier
|
* @property string $identifier
|
||||||
* @property string $token
|
* @property string $token
|
||||||
* @property string[] $permissions
|
* @property string[]|null $permissions
|
||||||
* @property string[] $allowed_ips
|
* @property string[]|null $allowed_ips
|
||||||
* @property string|null $memo
|
* @property string|null $memo
|
||||||
* @property \Illuminate\Support\Carbon|null $last_used_at
|
* @property \Illuminate\Support\Carbon|null $last_used_at
|
||||||
* @property \Illuminate\Support\Carbon|null $expires_at
|
* @property \Illuminate\Support\Carbon|null $expires_at
|
||||||
|
@ -22,7 +22,7 @@ return new class extends Migration
|
|||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::table('api_keys', function (Blueprint $table) {
|
Schema::table('api_keys', function (Blueprint $table) {
|
||||||
$table->json('permissions');
|
$table->json('permissions')->nullable();
|
||||||
});
|
});
|
||||||
|
|
||||||
foreach (ApiKey::all() as $apiKey) {
|
foreach (ApiKey::all() as $apiKey) {
|
||||||
@ -72,7 +72,7 @@ return new class extends Migration
|
|||||||
$table->unsignedTinyInteger('r_mounts')->default(0);
|
$table->unsignedTinyInteger('r_mounts')->default(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
foreach (ApiKey::query() as $apiKey) {
|
foreach (ApiKey::all() as $apiKey) {
|
||||||
DB::table('api_keys')
|
DB::table('api_keys')
|
||||||
->where('id', $apiKey->id)
|
->where('id', $apiKey->id)
|
||||||
->update([
|
->update([
|
||||||
|
Loading…
x
Reference in New Issue
Block a user