dbic sync between actual db & our functions/docs (#595)

This commit is contained in:
nick n
2019-05-27 13:39:07 +02:00
committed by Oliver Gorwits
parent f2ddf175b7
commit e65f7b84c8
12 changed files with 42 additions and 73 deletions

View File

@@ -35,7 +35,6 @@ lib/App/Netdisco/DB/Result/DevicePortSsid.pm
lib/App/Netdisco/DB/Result/DevicePortVlan.pm
lib/App/Netdisco/DB/Result/DevicePortWireless.pm
lib/App/Netdisco/DB/Result/DevicePower.pm
lib/App/Netdisco/DB/Result/DeviceRoute.pm
lib/App/Netdisco/DB/Result/DeviceSkip.pm
lib/App/Netdisco/DB/Result/DeviceVlan.pm
lib/App/Netdisco/DB/Result/Log.pm
@@ -371,6 +370,7 @@ share/schema_versions/App-Netdisco-DB-53-54-PostgreSQL.sql
share/schema_versions/App-Netdisco-DB-54-55-PostgreSQL.sql
share/schema_versions/App-Netdisco-DB-55-56-PostgreSQL.sql
share/schema_versions/App-Netdisco-DB-56-57-PostgreSQL.sql
share/schema_versions/App-Netdisco-DB-57-58-PostgreSQL.sql
share/schema_versions/App-Netdisco-DB-6-7-PostgreSQL.sql
share/schema_versions/App-Netdisco-DB-7-8-PostgreSQL.sql
share/schema_versions/App-Netdisco-DB-8-9-PostgreSQL.sql

View File

@@ -142,7 +142,7 @@
},
"App::Netdisco::DB" : {
"file" : "lib/App/Netdisco/DB.pm",
"version" : "57"
"version" : "58"
},
"App::Netdisco::DB::ExplicitLocking" : {
"file" : "lib/App/Netdisco/DB/ExplicitLocking.pm"
@@ -186,9 +186,6 @@
"App::Netdisco::DB::Result::DevicePower" : {
"file" : "lib/App/Netdisco/DB/Result/DevicePower.pm"
},
"App::Netdisco::DB::Result::DeviceRoute" : {
"file" : "lib/App/Netdisco/DB/Result/DeviceRoute.pm"
},
"App::Netdisco::DB::Result::DeviceSkip" : {
"file" : "lib/App/Netdisco/DB/Result/DeviceSkip.pm"
},
@@ -806,7 +803,7 @@
},
"homepage" : "http://netdisco.org/",
"license" : [
"http://opensource.org/licenses/bsd-license.php"
"http://opensource.org/licenses/BSD-3-Clause"
],
"repository" : {
"url" : "https://github.com/netdisco/netdisco"
@@ -815,5 +812,5 @@
"x_MailingList" : "https://lists.sourceforge.net/lists/listinfo/netdisco-users"
},
"version" : "2.042008",
"x_serialization_backend" : "JSON::PP version 2.97001"
"x_serialization_backend" : "JSON::PP version 4.02"
}

View File

@@ -38,7 +38,7 @@ provides:
file: lib/App/Netdisco/Configuration.pm
App::Netdisco::DB:
file: lib/App/Netdisco/DB.pm
version: '57'
version: '58'
App::Netdisco::DB::ExplicitLocking:
file: lib/App/Netdisco/DB/ExplicitLocking.pm
App::Netdisco::DB::Result::Admin:
@@ -67,8 +67,6 @@ provides:
file: lib/App/Netdisco/DB/Result/DevicePortWireless.pm
App::Netdisco::DB::Result::DevicePower:
file: lib/App/Netdisco/DB/Result/DevicePower.pm
App::Netdisco::DB::Result::DeviceRoute:
file: lib/App/Netdisco/DB/Result/DeviceRoute.pm
App::Netdisco::DB::Result::DeviceSkip:
file: lib/App/Netdisco/DB/Result/DeviceSkip.pm
App::Netdisco::DB::Result::DeviceVlan:
@@ -557,7 +555,7 @@ resources:
MailingList: https://lists.sourceforge.net/lists/listinfo/netdisco-users
bugtracker: https://github.com/netdisco/netdisco/issues
homepage: http://netdisco.org/
license: http://opensource.org/licenses/bsd-license.php
license: http://opensource.org/licenses/BSD-3-Clause
repository: https://github.com/netdisco/netdisco
version: '2.042008'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'

View File

@@ -57,13 +57,17 @@ there's no Nedisco schema, it is deployed. If there's an unversioned schema
then versioning is added, and updates applied. Otherwise only necessary
updates are applied to an already versioned schema.
Pre-existing requirements are that there be a database table created and a
user with rights to create tables in that database. Both the table and user
name must match those configured in your environment YAML file (default
C<~/environments/deployment.yml>).
Pre-existing requirements are that there's a working database connection and a
user with rights to create tables in that database. These settings are defined
in your environment YAML file (default C<~/environments/deployment.yml>).
If you wish to force the redeployment of all database configuration, pass the
C<--redeploy-all> argument on the command line.
C<--redeploy-all> argument on the command line. This will reset your database
version so the database scripts will run again, but no data will be deleted
other than what's done via the upgrade scripts.
For more database info see the
L<netdisco wiki|https://github.com/netdisco/netdisco/wiki/Database-Tips>.
=head1 VERSIONS

View File

@@ -11,7 +11,7 @@ __PACKAGE__->load_namespaces(
);
our # try to hide from kwalitee
$VERSION = 57; # schema version used for upgrades, keep as integer
$VERSION = 58; # schema version used for upgrades, keep as integer
use Path::Class;
use File::ShareDir 'dist_dir';

View File

@@ -56,13 +56,13 @@ __PACKAGE__->add_columns(
"remote_id",
{ data_type => "text", is_nullable => 1 },
"is_master",
{ data_type => "bool", is_nullable => 0, default_value => \"false" },
{ data_type => "boolean", is_nullable => 0, default_value => \"false" },
"slave_of",
{ data_type => "text", is_nullable => 1 },
"manual_topo",
{ data_type => "bool", is_nullable => 0, default_value => \"false" },
{ data_type => "boolean", is_nullable => 0, default_value => \"false" },
"is_uplink",
{ data_type => "bool", is_nullable => 1 },
{ data_type => "boolean", is_nullable => 1 },
"vlan",
{ data_type => "text", is_nullable => 1 },
"pvid",

View File

@@ -14,9 +14,9 @@ __PACKAGE__->add_columns(
"error_disable_cause",
{ data_type => "text", is_nullable => 1 },
"remote_is_wap",
{ data_type => "boolean", is_nullable => 1 },
{ data_type => "boolean", default_value => \"false", is_nullable => 1 },
"remote_is_phone",
{ data_type => "boolean", is_nullable => 1 },
{ data_type => "boolean", default_value => \"false", is_nullable => 1 },
"remote_vendor",
{ data_type => "text", is_nullable => 1 },
"remote_model",
@@ -26,9 +26,9 @@ __PACKAGE__->add_columns(
"remote_serial",
{ data_type => "text", is_nullable => 1 },
"raw_speed",
{ data_type => "bigint", is_nullable => 1 },
{ data_type => "bigint", default_value => 0, is_nullable => 1 },
"faststart",
{ data_type => "boolean", is_nullable => 1 },
{ data_type => "boolean", default_value => \"false", is_nullable => 1 },
"ifindex",
{ data_type => "bigint", is_nullable => 1 },
);

View File

@@ -19,10 +19,10 @@ __PACKAGE__->add_columns(
"broadcast",
{ data_type => "boolean", is_nullable => 1 },
"bssid",
{ data_type => "macaddr", is_nullable => 1 },
{ data_type => "macaddr", is_nullable => 0 },
);
__PACKAGE__->set_primary_key("port", "ip");
__PACKAGE__->set_primary_key("ip", "bssid", "port");
# Created by DBIx::Class::Schema::Loader v0.07015 @ 2012-01-07 14:20:02
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zvgylKzUQtizJZCe1rEdUg

View File

@@ -1,42 +0,0 @@
use utf8;
package App::Netdisco::DB::Result::DeviceRoute;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
use strict;
use warnings;
use base 'DBIx::Class::Core';
__PACKAGE__->table("device_route");
__PACKAGE__->add_columns(
"ip",
{ data_type => "inet", is_nullable => 0 },
"network",
{ data_type => "cidr", is_nullable => 0 },
"creation",
{
data_type => "timestamp",
default_value => \"current_timestamp",
is_nullable => 1,
original => { default_value => \"now()" },
},
"dest",
{ data_type => "inet", is_nullable => 0 },
"last_discover",
{
data_type => "timestamp",
default_value => \"current_timestamp",
is_nullable => 1,
original => { default_value => \"now()" },
},
);
__PACKAGE__->set_primary_key("ip", "network", "dest");
# Created by DBIx::Class::Schema::Loader v0.07015 @ 2012-01-07 14:20:02
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3jcvPP60E5BvwnUbXql7mQ
# You can replace this text with custom code or comments, and it will be preserved on regeneration
1;

View File

@@ -25,9 +25,9 @@ __PACKAGE__->add_columns(
"sigqual",
{ data_type => "integer", is_nullable => 1 },
"rxpkt",
{ data_type => "integer", is_nullable => 1 },
{ data_type => "bigint", is_nullable => 1 },
"txpkt",
{ data_type => "integer", is_nullable => 1 },
{ data_type => "bigint", is_nullable => 1 },
"rxbyte",
{ data_type => "bigint", is_nullable => 1 },
"txbyte",

View File

@@ -8,8 +8,7 @@ use base 'DBIx::Class::Core';
__PACKAGE__->table("statistics");
__PACKAGE__->add_columns(
"day",
{ data_type => "date", is_nullable => 0 },
{ data_type => "date", default_value => \"CURRENT_DATE", is_nullable => 0 },
"device_count",
{ data_type => "integer", is_nullable => 0 },
"device_ip_count",
@@ -28,7 +27,6 @@ __PACKAGE__->add_columns(
{ data_type => "integer", is_nullable => 0 },
"node_active_count",
{ data_type => "integer", is_nullable => 0 },
"netdisco_ver",
{ data_type => "text", is_nullable => 1 },
"snmpinfo_ver",

View File

@@ -0,0 +1,14 @@
BEGIN;
alter table device_port_wireless alter column ip set not null;
alter table device_port_wireless alter column port set not null;
alter table device_port_wireless add constraint device_port_wireless_pkey primary key (ip, port);
alter table device_port_ssid alter column ip set not null;
alter table device_port_ssid alter column port set not null;
alter table device_port_ssid alter column bssid set not null;
alter table device_port_ssid add constraint device_port_ssid_pkey primary key (ip, bssid, port);
COMMIT;