add unique constraints to topology table

This commit is contained in:
Oliver Gorwits
2013-04-27 18:39:12 +01:00
parent 2780b72e49
commit 09285d42b4
4 changed files with 15 additions and 1 deletions

View File

@@ -20,6 +20,7 @@
* Rename plugins developer doc to .pod
* Update to latest Bootstrap and JQuery, and temp. fix #7326 in Bootstrap
* Partial Name in Port search now working
* Add unique constraints to topology table
2.007000_001 - 2013-03-17

View File

@@ -8,7 +8,7 @@ use base 'DBIx::Class::Schema';
__PACKAGE__->load_namespaces;
our $VERSION = 17; # schema version used for upgrades, keep as integer
our $VERSION = 18; # schema version used for upgrades, keep as integer
use Path::Class;
use File::Basename;

View File

@@ -19,4 +19,7 @@ __PACKAGE__->add_columns(
{ data_type => "text", is_nullable => 0 },
);
__PACKAGE__->add_unique_constraint(['dev1','port1']);
__PACKAGE__->add_unique_constraint(['dev2','port2']);
1;

View File

@@ -0,0 +1,10 @@
-- Convert schema '/home/devver/netdisco-ng/Netdisco/bin/../lib/App/Netdisco/DB/schema_versions/App-Netdisco-DB-17-PostgreSQL.sql' to '/home/devver/netdisco-ng/Netdisco/bin/../lib/App/Netdisco/DB/schema_versions/App-Netdisco-DB-18-PostgreSQL.sql':;
BEGIN;
ALTER TABLE topology ADD CONSTRAINT topology_dev1_port1 UNIQUE (dev1, port1);
ALTER TABLE topology ADD CONSTRAINT topology_dev2_port2 UNIQUE (dev2, port2);
COMMIT;