forked from librenms/librenms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
log count of logged in users in Database (librenms#13137)
* log count of logged in users in Database * . * rewrite Code * create hrSystem Table * . * . * db adjustments * adjust db Table * . * adjust db Table * table redesign * . * .
- Loading branch information
1 parent
a828bb0
commit f47410e
Showing
5 changed files
with
69 additions
and
1 deletion.
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
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,12 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
class HrSystem extends DeviceRelatedModel | ||
{ | ||
public $timestamps = false; | ||
protected $table = 'hrSystem'; | ||
protected $fillable = ['hrSystemNumUsers', 'hrSystemProcesses', 'hrSystemMaxProcesses']; | ||
|
||
protected $primaryKey = 'hrSystem_id'; | ||
} |
33 changes: 33 additions & 0 deletions
33
database/migrations/2021_09_26_164200_create_hrsystem_table.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,33 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class CreateHrSystemTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::create('hrSystem', function (Blueprint $table) { | ||
$table->increments('hrSystem_id'); | ||
$table->unsignedInteger('device_id')->index(); | ||
$table->integer('hrSystemNumUsers')->default(0); | ||
$table->integer('hrSystemProcesses')->default(0); | ||
$table->integer('hrSystemMaxProcesses')->default(0); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::drop('hrSystem'); | ||
} | ||
} |
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