Add Max Concurrent Connections for database users

Closes #1849

Allows database users to be limited to a number of concurrent connections to prevent one user from connecting hundreds of time and bottlenecking the MySQL server.
This commit is contained in:
AreYouScared 2020-04-22 06:00:04 -04:00
parent 2c3a9228ec
commit f0e4764a11
10 changed files with 56 additions and 6 deletions

View file

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddMaxConnectionsColumnToDatabasesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('databases', function (Blueprint $table) {
$table->integer('max_connections')->nullable(false)->default(0)->after('password');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('databases', function (Blueprint $table) {
$table->dropColumn('max_connections');
});
}
}