-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #118 from fleetbase/dev-v1.5.15
v1.5.15
- Loading branch information
Showing
20 changed files
with
416 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
migrations/2024_10_17_075756_add_access_token_id_to_log_tables.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class() extends Migration { | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::disableForeignKeyConstraints(); | ||
|
||
Schema::table('api_events', function (Blueprint $table) { | ||
$table->foreignId('access_token_id')->nullable()->after('api_credential_uuid')->references(['id'])->on('personal_access_tokens')->onUpdate('CASCADE')->onDelete('CASCADE'); | ||
}); | ||
|
||
Schema::table('webhook_request_logs', function (Blueprint $table) { | ||
$table->foreignId('access_token_id')->nullable()->after('api_credential_uuid')->references(['id'])->on('personal_access_tokens')->onUpdate('CASCADE')->onDelete('CASCADE'); | ||
}); | ||
|
||
Schema::table('api_request_logs', function (Blueprint $table) { | ||
$table->foreignId('access_token_id')->nullable()->after('api_credential_uuid')->references(['id'])->on('personal_access_tokens')->onUpdate('CASCADE')->onDelete('CASCADE'); | ||
}); | ||
|
||
Schema::enableForeignKeyConstraints(); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::disableForeignKeyConstraints(); | ||
|
||
Schema::table('api_events', function (Blueprint $table) { | ||
$table->dropForeign(['access_token_id']); | ||
$table->dropColumn('access_token_id'); | ||
}); | ||
|
||
Schema::table('webhook_request_logs', function (Blueprint $table) { | ||
$table->dropForeign(['access_token_id']); | ||
$table->dropColumn('access_token_id'); | ||
}); | ||
|
||
Schema::table('api_request_logs', function (Blueprint $table) { | ||
$table->dropForeign(['access_token_id']); | ||
$table->dropColumn('access_token_id'); | ||
}); | ||
|
||
Schema::enableForeignKeyConstraints(); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.