diff --git a/database/migrations/2023_10_12_183306_ports_statistics_table_unsigned_stats.php b/database/migrations/2023_10_12_183306_ports_statistics_table_unsigned_stats.php new file mode 100644 index 0000000000..46338f10e9 --- /dev/null +++ b/database/migrations/2023_10_12_183306_ports_statistics_table_unsigned_stats.php @@ -0,0 +1,80 @@ +bigInteger('ifInNUcastPkts')->unsigned()->nullable()->change(); + $table->bigInteger('ifInNUcastPkts_prev')->unsigned()->nullable()->change(); + $table->bigInteger('ifInNUcastPkts_delta')->unsigned()->nullable()->change(); + $table->bigInteger('ifOutNUcastPkts')->unsigned()->nullable()->change(); + $table->bigInteger('ifOutNUcastPkts_prev')->unsigned()->nullable()->change(); + $table->bigInteger('ifOutNUcastPkts_delta')->unsigned()->nullable()->change(); + $table->bigInteger('ifInDiscards')->unsigned()->nullable()->change(); + $table->bigInteger('ifInDiscards_prev')->unsigned()->nullable()->change(); + $table->bigInteger('ifInDiscards_delta')->unsigned()->nullable()->change(); + $table->bigInteger('ifOutDiscards')->unsigned()->nullable()->change(); + $table->bigInteger('ifOutDiscards_prev')->unsigned()->nullable()->change(); + $table->bigInteger('ifOutDiscards_delta')->unsigned()->nullable()->change(); + $table->bigInteger('ifInUnknownProtos')->unsigned()->nullable()->change(); + $table->bigInteger('ifInUnknownProtos_prev')->unsigned()->nullable()->change(); + $table->bigInteger('ifInUnknownProtos_delta')->unsigned()->nullable()->change(); + $table->bigInteger('ifInBroadcastPkts')->unsigned()->nullable()->change(); + $table->bigInteger('ifInBroadcastPkts_prev')->unsigned()->nullable()->change(); + $table->bigInteger('ifInBroadcastPkts_delta')->unsigned()->nullable()->change(); + $table->bigInteger('ifOutBroadcastPkts')->unsigned()->nullable()->change(); + $table->bigInteger('ifOutBroadcastPkts_prev')->unsigned()->nullable()->change(); + $table->bigInteger('ifOutBroadcastPkts_delta')->unsigned()->nullable()->change(); + $table->bigInteger('ifInMulticastPkts')->unsigned()->nullable()->change(); + $table->bigInteger('ifInMulticastPkts_prev')->unsigned()->nullable()->change(); + $table->bigInteger('ifInMulticastPkts_delta')->unsigned()->nullable()->change(); + $table->bigInteger('ifOutMulticastPkts')->unsigned()->nullable()->change(); + $table->bigInteger('ifOutMulticastPkts_prev')->unsigned()->nullable()->change(); + $table->bigInteger('ifOutMulticastPkts_delta')->unsigned()->nullable()->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('ports_statistics', function (Blueprint $table) { + $table->bigInteger('ifInNUcastPkts')->nullable()->change(); + $table->bigInteger('ifInNUcastPkts_prev')->nullable()->change(); + $table->bigInteger('ifInNUcastPkts_delta')->nullable()->change(); + $table->bigInteger('ifOutNUcastPkts')->nullable()->change(); + $table->bigInteger('ifOutNUcastPkts_prev')->nullable()->change(); + $table->bigInteger('ifOutNUcastPkts_delta')->nullable()->change(); + $table->bigInteger('ifInDiscards')->nullable()->change(); + $table->bigInteger('ifInDiscards_prev')->nullable()->change(); + $table->bigInteger('ifInDiscards_delta')->nullable()->change(); + $table->bigInteger('ifOutDiscards')->nullable()->change(); + $table->bigInteger('ifOutDiscards_prev')->nullable()->change(); + $table->bigInteger('ifOutDiscards_delta')->nullable()->change(); + $table->bigInteger('ifInUnknownProtos')->nullable()->change(); + $table->bigInteger('ifInUnknownProtos_prev')->nullable()->change(); + $table->bigInteger('ifInUnknownProtos_delta')->nullable()->change(); + $table->bigInteger('ifInBroadcastPkts')->nullable()->change(); + $table->bigInteger('ifInBroadcastPkts_prev')->nullable()->change(); + $table->bigInteger('ifInBroadcastPkts_delta')->nullable()->change(); + $table->bigInteger('ifOutBroadcastPkts')->nullable()->change(); + $table->bigInteger('ifOutBroadcastPkts_prev')->nullable()->change(); + $table->bigInteger('ifOutBroadcastPkts_delta')->nullable()->change(); + $table->bigInteger('ifInMulticastPkts')->nullable()->change(); + $table->bigInteger('ifInMulticastPkts_prev')->nullable()->change(); + $table->bigInteger('ifInMulticastPkts_delta')->nullable()->change(); + $table->bigInteger('ifOutMulticastPkts')->nullable()->change(); + $table->bigInteger('ifOutMulticastPkts_prev')->nullable()->change(); + $table->bigInteger('ifOutMulticastPkts_delta')->nullable()->change(); + }); + } +}; diff --git a/database/migrations/2023_10_12_184311_bgp_peers_cbgp_table_unsigned_stats.php b/database/migrations/2023_10_12_184311_bgp_peers_cbgp_table_unsigned_stats.php new file mode 100644 index 0000000000..dbf3d52ade --- /dev/null +++ b/database/migrations/2023_10_12_184311_bgp_peers_cbgp_table_unsigned_stats.php @@ -0,0 +1,62 @@ +integer('AcceptedPrefixes')->unsigned()->change(); + $table->integer('DeniedPrefixes')->unsigned()->change(); + $table->integer('PrefixAdminLimit')->unsigned()->change(); + $table->integer('PrefixThreshold')->unsigned()->change(); + $table->integer('PrefixClearThreshold')->unsigned()->change(); + $table->integer('AdvertisedPrefixes')->unsigned()->change(); + $table->integer('SuppressedPrefixes')->unsigned()->change(); + $table->integer('WithdrawnPrefixes')->unsigned()->change(); + $table->integer('AcceptedPrefixes_delta')->unsigned()->change(); + $table->integer('AcceptedPrefixes_prev')->unsigned()->change(); + $table->integer('DeniedPrefixes_delta')->unsigned()->change(); + $table->integer('DeniedPrefixes_prev')->unsigned()->change(); + $table->integer('AdvertisedPrefixes_delta')->unsigned()->change(); + $table->integer('AdvertisedPrefixes_prev')->unsigned()->change(); + $table->integer('SuppressedPrefixes_delta')->unsigned()->change(); + $table->integer('SuppressedPrefixes_prev')->unsigned()->change(); + $table->integer('WithdrawnPrefixes_delta')->unsigned()->change(); + $table->integer('WithdrawnPrefixes_prev')->unsigned()->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('bgpPeers_cbgp', function (Blueprint $table) { + $table->integer('AcceptedPrefixes')->change(); + $table->integer('DeniedPrefixes')->change(); + $table->integer('PrefixAdminLimit')->change(); + $table->integer('PrefixThreshold')->change(); + $table->integer('PrefixClearThreshold')->change(); + $table->integer('AdvertisedPrefixes')->change(); + $table->integer('SuppressedPrefixes')->change(); + $table->integer('WithdrawnPrefixes')->change(); + $table->integer('AcceptedPrefixes_delta')->change(); + $table->integer('AcceptedPrefixes_prev')->change(); + $table->integer('DeniedPrefixes_delta')->change(); + $table->integer('DeniedPrefixes_prev')->change(); + $table->integer('AdvertisedPrefixes_delta')->change(); + $table->integer('AdvertisedPrefixes_prev')->change(); + $table->integer('SuppressedPrefixes_delta')->change(); + $table->integer('SuppressedPrefixes_prev')->change(); + $table->integer('WithdrawnPrefixes_delta')->change(); + $table->integer('WithdrawnPrefixes_prev')->change(); + }); + } +}; diff --git a/database/migrations/2023_10_12_184652_bgp_peers_table_unsigned_stats.php b/database/migrations/2023_10_12_184652_bgp_peers_table_unsigned_stats.php new file mode 100644 index 0000000000..03d5a0c2c5 --- /dev/null +++ b/database/migrations/2023_10_12_184652_bgp_peers_table_unsigned_stats.php @@ -0,0 +1,38 @@ +integer('bgpPeerInUpdates')->unsigned()->change(); + $table->integer('bgpPeerOutUpdates')->unsigned()->change(); + $table->integer('bgpPeerInTotalMessages')->unsigned()->change(); + $table->integer('bgpPeerOutTotalMessages')->unsigned()->change(); + $table->integer('bgpPeerFsmEstablishedTime')->unsigned()->change(); + $table->integer('bgpPeerInUpdateElapsedTime')->unsigned()->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('bgpPeers', function (Blueprint $table) { + $table->integer('bgpPeerInUpdates')->change(); + $table->integer('bgpPeerOutUpdates')->change(); + $table->integer('bgpPeerInTotalMessages')->change(); + $table->integer('bgpPeerOutTotalMessages')->change(); + $table->integer('bgpPeerFsmEstablishedTime')->change(); + $table->integer('bgpPeerInUpdateElapsedTime')->change(); + }); + } +}; diff --git a/misc/db_schema.yaml b/misc/db_schema.yaml index 28be04fcfe..ad36984335 100644 --- a/misc/db_schema.yaml +++ b/misc/db_schema.yaml @@ -253,12 +253,12 @@ bgpPeers: - { Field: bgpLocalAddr, Type: text, 'Null': false, Extra: '' } - { Field: bgpPeerRemoteAddr, Type: text, 'Null': false, Extra: '' } - { Field: bgpPeerDescr, Type: varchar(255), 'Null': false, Extra: '', Default: '' } - - { Field: bgpPeerInUpdates, Type: int, 'Null': false, Extra: '' } - - { Field: bgpPeerOutUpdates, Type: int, 'Null': false, Extra: '' } - - { Field: bgpPeerInTotalMessages, Type: int, 'Null': false, Extra: '' } - - { Field: bgpPeerOutTotalMessages, Type: int, 'Null': false, Extra: '' } - - { Field: bgpPeerFsmEstablishedTime, Type: int, 'Null': false, Extra: '' } - - { Field: bgpPeerInUpdateElapsedTime, Type: int, 'Null': false, Extra: '' } + - { Field: bgpPeerInUpdates, Type: 'int unsigned', 'Null': false, Extra: '' } + - { Field: bgpPeerOutUpdates, Type: 'int unsigned', 'Null': false, Extra: '' } + - { Field: bgpPeerInTotalMessages, Type: 'int unsigned', 'Null': false, Extra: '' } + - { Field: bgpPeerOutTotalMessages, Type: 'int unsigned', 'Null': false, Extra: '' } + - { Field: bgpPeerFsmEstablishedTime, Type: 'int unsigned', 'Null': false, Extra: '' } + - { Field: bgpPeerInUpdateElapsedTime, Type: 'int unsigned', 'Null': false, Extra: '' } - { Field: context_name, Type: varchar(128), 'Null': true, Extra: '' } Indexes: PRIMARY: { Name: PRIMARY, Columns: [bgpPeer_id], Unique: true, Type: BTREE } @@ -269,24 +269,24 @@ bgpPeers_cbgp: - { Field: bgpPeerIdentifier, Type: varchar(64), 'Null': false, Extra: '' } - { Field: afi, Type: varchar(16), 'Null': false, Extra: '' } - { Field: safi, Type: varchar(16), 'Null': false, Extra: '' } - - { Field: AcceptedPrefixes, Type: int, 'Null': false, Extra: '' } - - { Field: DeniedPrefixes, Type: int, 'Null': false, Extra: '' } - - { Field: PrefixAdminLimit, Type: int, 'Null': false, Extra: '' } - - { Field: PrefixThreshold, Type: int, 'Null': false, Extra: '' } - - { Field: PrefixClearThreshold, Type: int, 'Null': false, Extra: '' } - - { Field: AdvertisedPrefixes, Type: int, 'Null': false, Extra: '' } - - { Field: SuppressedPrefixes, Type: int, 'Null': false, Extra: '' } - - { Field: WithdrawnPrefixes, Type: int, 'Null': false, Extra: '' } - - { Field: AcceptedPrefixes_delta, Type: int, 'Null': false, Extra: '' } - - { Field: AcceptedPrefixes_prev, Type: int, 'Null': false, Extra: '' } - - { Field: DeniedPrefixes_delta, Type: int, 'Null': false, Extra: '' } - - { Field: DeniedPrefixes_prev, Type: int, 'Null': false, Extra: '' } - - { Field: AdvertisedPrefixes_delta, Type: int, 'Null': false, Extra: '' } - - { Field: AdvertisedPrefixes_prev, Type: int, 'Null': false, Extra: '' } - - { Field: SuppressedPrefixes_delta, Type: int, 'Null': false, Extra: '' } - - { Field: SuppressedPrefixes_prev, Type: int, 'Null': false, Extra: '' } - - { Field: WithdrawnPrefixes_delta, Type: int, 'Null': false, Extra: '' } - - { Field: WithdrawnPrefixes_prev, Type: int, 'Null': false, Extra: '' } + - { Field: AcceptedPrefixes, Type: 'int unsigned', 'Null': false, Extra: '' } + - { Field: DeniedPrefixes, Type: 'int unsigned', 'Null': false, Extra: '' } + - { Field: PrefixAdminLimit, Type: 'int unsigned', 'Null': false, Extra: '' } + - { Field: PrefixThreshold, Type: 'int unsigned', 'Null': false, Extra: '' } + - { Field: PrefixClearThreshold, Type: 'int unsigned', 'Null': false, Extra: '' } + - { Field: AdvertisedPrefixes, Type: 'int unsigned', 'Null': false, Extra: '' } + - { Field: SuppressedPrefixes, Type: 'int unsigned', 'Null': false, Extra: '' } + - { Field: WithdrawnPrefixes, Type: 'int unsigned', 'Null': false, Extra: '' } + - { Field: AcceptedPrefixes_delta, Type: 'int unsigned', 'Null': false, Extra: '' } + - { Field: AcceptedPrefixes_prev, Type: 'int unsigned', 'Null': false, Extra: '' } + - { Field: DeniedPrefixes_delta, Type: 'int unsigned', 'Null': false, Extra: '' } + - { Field: DeniedPrefixes_prev, Type: 'int unsigned', 'Null': false, Extra: '' } + - { Field: AdvertisedPrefixes_delta, Type: 'int unsigned', 'Null': false, Extra: '' } + - { Field: AdvertisedPrefixes_prev, Type: 'int unsigned', 'Null': false, Extra: '' } + - { Field: SuppressedPrefixes_delta, Type: 'int unsigned', 'Null': false, Extra: '' } + - { Field: SuppressedPrefixes_prev, Type: 'int unsigned', 'Null': false, Extra: '' } + - { Field: WithdrawnPrefixes_delta, Type: 'int unsigned', 'Null': false, Extra: '' } + - { Field: WithdrawnPrefixes_prev, Type: 'int unsigned', 'Null': false, Extra: '' } - { Field: context_name, Type: varchar(128), 'Null': true, Extra: '' } Indexes: bgppeers_cbgp_device_id_bgppeeridentifier_afi_safi_unique: { Name: bgppeers_cbgp_device_id_bgppeeridentifier_afi_safi_unique, Columns: [device_id, bgpPeerIdentifier, afi, safi], Unique: true, Type: BTREE } @@ -1619,41 +1619,41 @@ ports_stack: ports_statistics: Columns: - { Field: port_id, Type: 'int unsigned', 'Null': false, Extra: '' } - - { Field: ifInNUcastPkts, Type: bigint, 'Null': true, Extra: '' } - - { Field: ifInNUcastPkts_prev, Type: bigint, 'Null': true, Extra: '' } - - { Field: ifInNUcastPkts_delta, Type: bigint, 'Null': true, Extra: '' } + - { Field: ifInNUcastPkts, Type: 'bigint unsigned', 'Null': true, Extra: '' } + - { Field: ifInNUcastPkts_prev, Type: 'bigint unsigned', 'Null': true, Extra: '' } + - { Field: ifInNUcastPkts_delta, Type: 'bigint unsigned', 'Null': true, Extra: '' } - { Field: ifInNUcastPkts_rate, Type: int, 'Null': true, Extra: '' } - - { Field: ifOutNUcastPkts, Type: bigint, 'Null': true, Extra: '' } - - { Field: ifOutNUcastPkts_prev, Type: bigint, 'Null': true, Extra: '' } - - { Field: ifOutNUcastPkts_delta, Type: bigint, 'Null': true, Extra: '' } + - { Field: ifOutNUcastPkts, Type: 'bigint unsigned', 'Null': true, Extra: '' } + - { Field: ifOutNUcastPkts_prev, Type: 'bigint unsigned', 'Null': true, Extra: '' } + - { Field: ifOutNUcastPkts_delta, Type: 'bigint unsigned', 'Null': true, Extra: '' } - { Field: ifOutNUcastPkts_rate, Type: int, 'Null': true, Extra: '' } - - { Field: ifInDiscards, Type: bigint, 'Null': true, Extra: '' } - - { Field: ifInDiscards_prev, Type: bigint, 'Null': true, Extra: '' } - - { Field: ifInDiscards_delta, Type: bigint, 'Null': true, Extra: '' } + - { Field: ifInDiscards, Type: 'bigint unsigned', 'Null': true, Extra: '' } + - { Field: ifInDiscards_prev, Type: 'bigint unsigned', 'Null': true, Extra: '' } + - { Field: ifInDiscards_delta, Type: 'bigint unsigned', 'Null': true, Extra: '' } - { Field: ifInDiscards_rate, Type: int, 'Null': true, Extra: '' } - - { Field: ifOutDiscards, Type: bigint, 'Null': true, Extra: '' } - - { Field: ifOutDiscards_prev, Type: bigint, 'Null': true, Extra: '' } - - { Field: ifOutDiscards_delta, Type: bigint, 'Null': true, Extra: '' } + - { Field: ifOutDiscards, Type: 'bigint unsigned', 'Null': true, Extra: '' } + - { Field: ifOutDiscards_prev, Type: 'bigint unsigned', 'Null': true, Extra: '' } + - { Field: ifOutDiscards_delta, Type: 'bigint unsigned', 'Null': true, Extra: '' } - { Field: ifOutDiscards_rate, Type: int, 'Null': true, Extra: '' } - - { Field: ifInUnknownProtos, Type: bigint, 'Null': true, Extra: '' } - - { Field: ifInUnknownProtos_prev, Type: bigint, 'Null': true, Extra: '' } - - { Field: ifInUnknownProtos_delta, Type: bigint, 'Null': true, Extra: '' } + - { Field: ifInUnknownProtos, Type: 'bigint unsigned', 'Null': true, Extra: '' } + - { Field: ifInUnknownProtos_prev, Type: 'bigint unsigned', 'Null': true, Extra: '' } + - { Field: ifInUnknownProtos_delta, Type: 'bigint unsigned', 'Null': true, Extra: '' } - { Field: ifInUnknownProtos_rate, Type: int, 'Null': true, Extra: '' } - - { Field: ifInBroadcastPkts, Type: bigint, 'Null': true, Extra: '' } - - { Field: ifInBroadcastPkts_prev, Type: bigint, 'Null': true, Extra: '' } - - { Field: ifInBroadcastPkts_delta, Type: bigint, 'Null': true, Extra: '' } + - { Field: ifInBroadcastPkts, Type: 'bigint unsigned', 'Null': true, Extra: '' } + - { Field: ifInBroadcastPkts_prev, Type: 'bigint unsigned', 'Null': true, Extra: '' } + - { Field: ifInBroadcastPkts_delta, Type: 'bigint unsigned', 'Null': true, Extra: '' } - { Field: ifInBroadcastPkts_rate, Type: int, 'Null': true, Extra: '' } - - { Field: ifOutBroadcastPkts, Type: bigint, 'Null': true, Extra: '' } - - { Field: ifOutBroadcastPkts_prev, Type: bigint, 'Null': true, Extra: '' } - - { Field: ifOutBroadcastPkts_delta, Type: bigint, 'Null': true, Extra: '' } + - { Field: ifOutBroadcastPkts, Type: 'bigint unsigned', 'Null': true, Extra: '' } + - { Field: ifOutBroadcastPkts_prev, Type: 'bigint unsigned', 'Null': true, Extra: '' } + - { Field: ifOutBroadcastPkts_delta, Type: 'bigint unsigned', 'Null': true, Extra: '' } - { Field: ifOutBroadcastPkts_rate, Type: int, 'Null': true, Extra: '' } - - { Field: ifInMulticastPkts, Type: bigint, 'Null': true, Extra: '' } - - { Field: ifInMulticastPkts_prev, Type: bigint, 'Null': true, Extra: '' } - - { Field: ifInMulticastPkts_delta, Type: bigint, 'Null': true, Extra: '' } + - { Field: ifInMulticastPkts, Type: 'bigint unsigned', 'Null': true, Extra: '' } + - { Field: ifInMulticastPkts_prev, Type: 'bigint unsigned', 'Null': true, Extra: '' } + - { Field: ifInMulticastPkts_delta, Type: 'bigint unsigned', 'Null': true, Extra: '' } - { Field: ifInMulticastPkts_rate, Type: int, 'Null': true, Extra: '' } - - { Field: ifOutMulticastPkts, Type: bigint, 'Null': true, Extra: '' } - - { Field: ifOutMulticastPkts_prev, Type: bigint, 'Null': true, Extra: '' } - - { Field: ifOutMulticastPkts_delta, Type: bigint, 'Null': true, Extra: '' } + - { Field: ifOutMulticastPkts, Type: 'bigint unsigned', 'Null': true, Extra: '' } + - { Field: ifOutMulticastPkts_prev, Type: 'bigint unsigned', 'Null': true, Extra: '' } + - { Field: ifOutMulticastPkts_delta, Type: 'bigint unsigned', 'Null': true, Extra: '' } - { Field: ifOutMulticastPkts_rate, Type: int, 'Null': true, Extra: '' } Indexes: PRIMARY: { Name: PRIMARY, Columns: [port_id], Unique: true, Type: BTREE }