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.
schema: add missing primary keys (librenms#12106)
* schema: add missing primary keys * Exclude ipv4_mac.id * Made primary key migrations SQLite compatible Co-authored-by: Tony Murray <[email protected]>
- Loading branch information
1 parent
3bfafc8
commit 2ca6f2f
Showing
22 changed files
with
405 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
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
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
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
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
37 changes: 37 additions & 0 deletions
37
database/migrations/2020_10_03_1000_add_primary_key_bill_perms.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,37 @@ | ||
<?php | ||
|
||
/* | ||
This migration adds primary key for table bill_perms. | ||
Percona Xtradb refuses to modify a table | ||
without a primary key. | ||
*/ | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class AddPrimaryKeyBillPerms extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
if (! Schema::hasColumn('bill_perms', 'id')) { | ||
Schema::table('bill_perms', function (Blueprint $table) { | ||
$table->id()->first(); | ||
}); | ||
} | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
database/migrations/2020_10_03_1000_add_primary_key_bill_ports.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,37 @@ | ||
<?php | ||
|
||
/* | ||
This migration adds primary key for table bill_ports. | ||
Percona Xtradb refuses to modify a table | ||
without a primary key. | ||
*/ | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class AddPrimaryKeyBillPorts extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
if (! Schema::hasColumn('bill_ports', 'id')) { | ||
Schema::table('bill_ports', function (Blueprint $table) { | ||
$table->id()->first(); | ||
}); | ||
} | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
database/migrations/2020_10_03_1000_add_primary_key_devices_perms.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,37 @@ | ||
<?php | ||
|
||
/* | ||
This migration adds primary key for table devices_perms. | ||
Percona Xtradb refuses to modify a table | ||
without a primary key. | ||
*/ | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class AddPrimaryKeyDevicesPerms extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
if (! Schema::hasColumn('devices_perms', 'id')) { | ||
Schema::table('devices_perms', function (Blueprint $table) { | ||
$table->id()->first(); | ||
}); | ||
} | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
database/migrations/2020_10_03_1000_add_primary_key_entPhysical_state.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,37 @@ | ||
<?php | ||
|
||
/* | ||
This migration adds primary key for table entPhysical_state. | ||
Percona Xtradb refuses to modify a table | ||
without a primary key. | ||
*/ | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class AddPrimaryKeyEntphysicalState extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
if (! Schema::hasColumn('entPhysical_state', 'id')) { | ||
Schema::table('entPhysical_state', function (Blueprint $table) { | ||
$table->id()->first(); | ||
}); | ||
} | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
database/migrations/2020_10_03_1000_add_primary_key_ipv4_mac.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,37 @@ | ||
<?php | ||
|
||
/* | ||
This migration adds primary key for table ipv4_mac. | ||
Percona Xtradb refuses to modify a table | ||
without a primary key. | ||
*/ | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class AddPrimaryKeyIpv4Mac extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
if (! Schema::hasColumn('ipv4_mac', 'id')) { | ||
Schema::table('ipv4_mac', function (Blueprint $table) { | ||
$table->id()->first(); | ||
}); | ||
} | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
database/migrations/2020_10_03_1000_add_primary_key_juniAtmVp.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,37 @@ | ||
<?php | ||
|
||
/* | ||
This migration adds primary key for table juniAtmVp. | ||
Percona Xtradb refuses to modify a table | ||
without a primary key. | ||
*/ | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class AddPrimaryKeyJuniatmvp extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
if (! Schema::hasColumn('juniAtmVp', 'id')) { | ||
Schema::table('juniAtmVp', function (Blueprint $table) { | ||
$table->id()->first(); | ||
}); | ||
} | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
database/migrations/2020_10_03_1000_add_primary_key_loadbalancer_vservers.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,37 @@ | ||
<?php | ||
|
||
/* | ||
This migration adds primary key for table loadbalancer_vservers. | ||
Percona Xtradb refuses to modify a table | ||
without a primary key. | ||
*/ | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class AddPrimaryKeyLoadbalancerVservers extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
if (! Schema::hasColumn('loadbalancer_vservers', 'id')) { | ||
Schema::table('loadbalancer_vservers', function (Blueprint $table) { | ||
$table->id()->first(); | ||
}); | ||
} | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
database/migrations/2020_10_03_1000_add_primary_key_ports_perms.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,37 @@ | ||
<?php | ||
|
||
/* | ||
This migration adds primary key for table ports_perms. | ||
Percona Xtradb refuses to modify a table | ||
without a primary key. | ||
*/ | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class AddPrimaryKeyPortsPerms extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
if (! Schema::hasColumn('ports_perms', 'id')) { | ||
Schema::table('ports_perms', function (Blueprint $table) { | ||
$table->id()->first(); | ||
}); | ||
} | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
} | ||
} |
Oops, something went wrong.