mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Database: add primary key to device_graphs (#11331)
* Database: add primary key to device_graphs Percona Xtradb refused to INSERT IGNORE into a table without a primary key. * Update 2020_03_24_0844_add_primary_key_to_device_graphs.php * Update db_schema.yaml Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
committed by
GitHub
parent
a70313f3ee
commit
676a120510
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
This migration adds primary key for device_graphs
|
||||
|
||||
Percona Xtradb refused to INSERT IGNORE into a table
|
||||
without a primary key.
|
||||
*/
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class AddPrimaryKeyToDeviceGraphs extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('device_graphs', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('device_graphs', function (Blueprint $table) {
|
||||
$table->dropColumn('id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -545,7 +545,9 @@ device_graphs:
|
||||
Columns:
|
||||
- { Field: device_id, Type: 'int(10) unsigned', 'Null': false, Extra: '' }
|
||||
- { Field: graph, Type: varchar(255), 'Null': true, Extra: '' }
|
||||
- { Field: id, Type: 'bigint(20) unsigned', 'Null': false, Extra: auto_increment }
|
||||
Indexes:
|
||||
PRIMARY: { Name: PRIMARY, Columns: [id], Unique: true, Type: BTREE }
|
||||
device_id: { Name: device_id, Columns: [device_id], Unique: false, Type: BTREE }
|
||||
device_groups:
|
||||
Columns:
|
||||
|
||||
Reference in New Issue
Block a user