diff --git a/Netdisco/lib/Netdisco/DB/Result/DevicePortSsid.pm b/Netdisco/lib/Netdisco/DB/Result/DevicePortSsid.pm index fa83396d..46acf3e1 100644 --- a/Netdisco/lib/Netdisco/DB/Result/DevicePortSsid.pm +++ b/Netdisco/lib/Netdisco/DB/Result/DevicePortSsid.pm @@ -18,6 +18,8 @@ __PACKAGE__->add_columns( { data_type => "text", is_nullable => 1 }, "broadcast", { data_type => "boolean", is_nullable => 1 }, + "bssid", + { data_type => "macaddr", is_nullable => 1 }, ); diff --git a/Netdisco/lib/Netdisco/DB/Result/DevicePortVlan.pm b/Netdisco/lib/Netdisco/DB/Result/DevicePortVlan.pm index 9616b3ce..2b262e61 100644 --- a/Netdisco/lib/Netdisco/DB/Result/DevicePortVlan.pm +++ b/Netdisco/lib/Netdisco/DB/Result/DevicePortVlan.pm @@ -32,6 +32,8 @@ __PACKAGE__->add_columns( is_nullable => 1, original => { default_value => \"now()" }, }, + "vlantype", + { data_type => "text", is_nullable => 1 }, ); __PACKAGE__->set_primary_key("ip", "port", "vlan"); diff --git a/Netdisco/lib/Netdisco/DB/Result/Topology.pm b/Netdisco/lib/Netdisco/DB/Result/Topology.pm new file mode 100644 index 00000000..b0b953a4 --- /dev/null +++ b/Netdisco/lib/Netdisco/DB/Result/Topology.pm @@ -0,0 +1,22 @@ +use utf8; +package Netdisco::DB::Result::Topology; + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +__PACKAGE__->table("topology"); + +__PACKAGE__->add_columns( + "dev1", + { data_type => "inet", is_nullable => 0 }, + "port1", + { data_type => "text", is_nullable => 0 }, + "dev2", + { data_type => "inet", is_nullable => 0 }, + "port2", + { data_type => "text", is_nullable => 0 }, +); + +1; diff --git a/Netdisco/lib/Netdisco/DB/schema_versions/Netdisco-DB-1-2-PostgreSQL.sql b/Netdisco/lib/Netdisco/DB/schema_versions/Netdisco-DB-1-2-PostgreSQL.sql index 8bd900c6..bc5481f5 100644 --- a/Netdisco/lib/Netdisco/DB/schema_versions/Netdisco-DB-1-2-PostgreSQL.sql +++ b/Netdisco/lib/Netdisco/DB/schema_versions/Netdisco-DB-1-2-PostgreSQL.sql @@ -2,6 +2,17 @@ BEGIN; +CREATE TABLE "topology" ( + "dev1" inet NOT NULL, + "port1" text NOT NULL, + "dev2" inet NOT NULL, + "port2" text NOT NULL +); + +ALTER TABLE device_port_ssid ADD COLUMN bssid macaddr; + +ALTER TABLE device_port_vlan ADD COLUMN vlantype text; + ALTER TABLE node_ip ADD COLUMN dns text; diff --git a/Netdisco/lib/Netdisco/DB/schema_versions/Netdisco-DB-2-PostgreSQL.sql b/Netdisco/lib/Netdisco/DB/schema_versions/Netdisco-DB-2-PostgreSQL.sql index 2f487270..b68828fc 100644 --- a/Netdisco/lib/Netdisco/DB/schema_versions/Netdisco-DB-2-PostgreSQL.sql +++ b/Netdisco/lib/Netdisco/DB/schema_versions/Netdisco-DB-2-PostgreSQL.sql @@ -1,6 +1,6 @@ -- -- Created by SQL::Translator::Producer::PostgreSQL --- Created on Wed Oct 10 14:26:06 2012 +-- Created on Wed Oct 10 15:38:36 2012 -- -- -- Table: admin. @@ -123,7 +123,8 @@ CREATE TABLE "device_port_ssid" ( "ip" inet, "port" text, "ssid" text, - "broadcast" boolean + "broadcast" boolean, + "bssid" macaddr ); -- @@ -282,6 +283,17 @@ CREATE TABLE "subnets" ( PRIMARY KEY ("net") ); +-- +-- Table: topology. +-- +DROP TABLE "topology" CASCADE; +CREATE TABLE "topology" ( + "dev1" inet NOT NULL, + "port1" text NOT NULL, + "dev2" inet NOT NULL, + "port2" text NOT NULL +); + -- -- Table: user_log. -- @@ -385,6 +397,7 @@ CREATE TABLE "device_port_vlan" ( "native" boolean DEFAULT false NOT NULL, "creation" timestamp DEFAULT current_timestamp, "last_discover" timestamp DEFAULT current_timestamp, + "vlantype" text, PRIMARY KEY ("ip", "port", "vlan") ); CREATE INDEX "device_port_vlan_idx_ip" on "device_port_vlan" ("ip");