Add ApiKey service, cleanup old API key methods
https://zube.io/pterodactyl/panel/c/525
This commit is contained in:
parent
2235481765
commit
4ee9d38ad1
10 changed files with 569 additions and 85 deletions
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class ChangeForeignKeyToBeOnCascadeDelete extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('api_permissions', function (Blueprint $table) {
|
||||
$table->dropForeign(['key_id']);
|
||||
|
||||
$table->foreign('key_id')->references('id')->on('api_keys')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('api_permissions', function (Blueprint $table) {
|
||||
$table->dropForeign(['key_id']);
|
||||
|
||||
$table->foreign('key_id')->references('id')->on('api_keys');
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue