This commit is contained in:
Alex Renoki 2020-09-10 23:20:19 +03:00
parent 7a77445122
commit 544b0a120d
3 changed files with 40 additions and 3 deletions

View File

@ -16,9 +16,9 @@ class CreateWebSocketsStatisticsEntriesTable extends Migration
Schema::create('websockets_statistics_entries', function (Blueprint $table) { Schema::create('websockets_statistics_entries', function (Blueprint $table) {
$table->increments('id'); $table->increments('id');
$table->string('app_id'); $table->string('app_id');
$table->integer('peak_connections_count'); $table->integer('peak_connection_count');
$table->integer('websocket_messages_count'); $table->integer('websocket_message_count');
$table->integer('api_messages_count'); $table->integer('api_message_count');
$table->nullableTimestamps(); $table->nullableTimestamps();
}); });
} }

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class RenameStatisticsCounters extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('websockets_statistics_entries', function (Blueprint $table) {
$table->renameColumn('peak_connection_count', 'peak_connections_count');
$table->renameColumn('websocket_message_count', 'websocket_messages_count');
$table->renameColumn('api_message_count', 'api_messages_count');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('websockets_statistics_entries', function (Blueprint $table) {
$table->renameColumn('peak_connections_count', 'peak_connection_count');
$table->renameColumn('websocket_messages_count', 'websocket_message_count');
$table->renameColumn('api_messages_count', 'api_message_count');
});
}
}

View File

@ -31,6 +31,7 @@ class WebSocketsServiceProvider extends ServiceProvider
$this->publishes([ $this->publishes([
__DIR__.'/../database/migrations/0000_00_00_000000_create_websockets_statistics_entries_table.php' => database_path('migrations/0000_00_00_000000_create_websockets_statistics_entries_table.php'), __DIR__.'/../database/migrations/0000_00_00_000000_create_websockets_statistics_entries_table.php' => database_path('migrations/0000_00_00_000000_create_websockets_statistics_entries_table.php'),
__DIR__.'/../database/migrations/0000_00_00_000000_rename_statistics_counters.php' => database_path('migrations/0000_00_00_000000_rename_statistics_counters.php'),
], 'migrations'); ], 'migrations');
$this->registerDashboard(); $this->registerDashboard();