diff --git a/lib/App/Netdisco/DB.pm b/lib/App/Netdisco/DB.pm index 008b5369..5c589386 100644 --- a/lib/App/Netdisco/DB.pm +++ b/lib/App/Netdisco/DB.pm @@ -11,7 +11,7 @@ __PACKAGE__->load_namespaces( ); our # try to hide from kwalitee - $VERSION = 53; # schema version used for upgrades, keep as integer + $VERSION = 54; # schema version used for upgrades, keep as integer use Path::Class; use File::ShareDir 'dist_dir'; diff --git a/lib/App/Netdisco/DB/Result/DevicePort.pm b/lib/App/Netdisco/DB/Result/DevicePort.pm index 216cf869..73f8d659 100644 --- a/lib/App/Netdisco/DB/Result/DevicePort.pm +++ b/lib/App/Netdisco/DB/Result/DevicePort.pm @@ -69,6 +69,8 @@ __PACKAGE__->add_columns( { data_type => "integer", is_nullable => 1 }, "lastchange", { data_type => "bigint", is_nullable => 1 }, + "ifindex", + { data_type => "bigint", is_nullable => 1 }, ); __PACKAGE__->set_primary_key("port", "ip"); diff --git a/lib/App/Netdisco/Worker/Plugin/Discover/Properties.pm b/lib/App/Netdisco/Worker/Plugin/Discover/Properties.pm index 63240c3d..a8722ef4 100644 --- a/lib/App/Netdisco/Worker/Plugin/Discover/Properties.pm +++ b/lib/App/Netdisco/Worker/Plugin/Discover/Properties.pm @@ -229,6 +229,7 @@ register_worker({ phase => 'early', driver => 'snmp' }, sub { type => $i_type->{$entry}, vlan => $i_vlan->{$entry}, pvid => $i_vlan->{$entry}, + ifindex => $entry, is_master => 'false', slave_of => undef, lastchange => $lc, diff --git a/share/schema_versions/App-Netdisco-DB-53-54-PostgreSQL.sql b/share/schema_versions/App-Netdisco-DB-53-54-PostgreSQL.sql new file mode 100644 index 00000000..c259afc5 --- /dev/null +++ b/share/schema_versions/App-Netdisco-DB-53-54-PostgreSQL.sql @@ -0,0 +1,5 @@ +BEGIN; + +ALTER TABLE device_port ADD COLUMN "ifindex" bigint; + +COMMIT;