add latest schema update

This commit is contained in:
Oliver Gorwits
2012-10-17 15:27:10 +01:00
parent c2634a5dea
commit 1fb029fff2
5 changed files with 52 additions and 2 deletions

View File

@@ -18,6 +18,8 @@ __PACKAGE__->add_columns(
{ data_type => "text", is_nullable => 1 }, { data_type => "text", is_nullable => 1 },
"broadcast", "broadcast",
{ data_type => "boolean", is_nullable => 1 }, { data_type => "boolean", is_nullable => 1 },
"bssid",
{ data_type => "macaddr", is_nullable => 1 },
); );

View File

@@ -32,6 +32,8 @@ __PACKAGE__->add_columns(
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"now()" },
}, },
"vlantype",
{ data_type => "text", is_nullable => 1 },
); );
__PACKAGE__->set_primary_key("ip", "port", "vlan"); __PACKAGE__->set_primary_key("ip", "port", "vlan");

View File

@@ -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;

View File

@@ -2,6 +2,17 @@
BEGIN; 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; ALTER TABLE node_ip ADD COLUMN dns text;

View File

@@ -1,6 +1,6 @@
-- --
-- Created by SQL::Translator::Producer::PostgreSQL -- 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. -- Table: admin.
@@ -123,7 +123,8 @@ CREATE TABLE "device_port_ssid" (
"ip" inet, "ip" inet,
"port" text, "port" text,
"ssid" text, "ssid" text,
"broadcast" boolean "broadcast" boolean,
"bssid" macaddr
); );
-- --
@@ -282,6 +283,17 @@ CREATE TABLE "subnets" (
PRIMARY KEY ("net") 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. -- Table: user_log.
-- --
@@ -385,6 +397,7 @@ CREATE TABLE "device_port_vlan" (
"native" boolean DEFAULT false NOT NULL, "native" boolean DEFAULT false NOT NULL,
"creation" timestamp DEFAULT current_timestamp, "creation" timestamp DEFAULT current_timestamp,
"last_discover" timestamp DEFAULT current_timestamp, "last_discover" timestamp DEFAULT current_timestamp,
"vlantype" text,
PRIMARY KEY ("ip", "port", "vlan") PRIMARY KEY ("ip", "port", "vlan")
); );
CREATE INDEX "device_port_vlan_idx_ip" on "device_port_vlan" ("ip"); CREATE INDEX "device_port_vlan_idx_ip" on "device_port_vlan" ("ip");