Nets Database Schema

Copyright (C) 1999-2005
Mike McCauley and Hugh Irvine

The standard Nets database schema.
For Nets Revision 2.5

1.0 Introduction

This document describes the database schema underlying Nets. The database is designed to be compatible with a wide range of SQL databases, and the description of the objects is designed to be independent of any specific database.

The database is intended to provide a firm foundation for Nets and other applications, yet still be extensible for site-specific purposes.

You can extend and alter the schema by editing the file Nets/Schema.pm in the Nets distribution.

2.0 Object Relationships

FIGURE 1. Database Entity-Relationship Diagram
FIGURE 2. Database Entity-Relationship Diagram (continued)
FIGURE 3. Database Entity-Relationship Diagram (continued)

3.0 Object Descriptions

3.1 ADDRESS

Describes a network address

TABLE 1. ADDRESS

Column Name

Data Type

Description

ADDRESSTYPE

FK

Address Type Foreign Key

DESCRIPTION

varchar

Description of this address

DNSNAME

varchar

DNS name associated with this address (if it makes sense)

ID

int PK

Auto-generated Primary Key

NAME

varchar

Name for this address

NETMASK

varchar

Netmask for this address (if it makes sense)

OVERSION

version

Auto-maintained version number

3.2 ADDRESSSTATE

Describes an address state.

TABLE 2. ADDRESSSTATE

Column Name

Data Type

Description

DESCRIPTION

int

Description of this address state

ID

int PK

Auto-generated Primary Key

NAME

varchar

Name for this address state

OVERSION

version

Auto-maintained version number

3.3 ADDRESSTYPE

Describes an address type.

TABLE 3. ADDRESSTYPE

Column Name

Data Type

Description

FAMILY

int

Address family

ID

int PK

Auto-generated Primary Key

NAME

varchar

Name for this address type

OVERSION

version

Auto-maintained version number

3.4 ADMINSTATE

Describes an administrative state.

TABLE 4. ADMINSTATE

Column Name

Data Type

Description

DESCRIPTION

varchar

Description of this administrative state

ID

int PK

Auto-generated Primary Key

NAME

varchar

Name for this administrative state

OVERSION

version

Auto-maintained version number

3.5 BUNDLE

Describes a cable bundle.

TABLE 5. BUNDLE

Column Name

Data Type

Description

DESCRIPTION

varchar

Description of this bundle

ID

int PK

Auto-generated Primary Key

NAME

varchar

Name for this bundle

OVERSION

version

Auto-maintained version number

3.6 CARD

Describes a card.

TABLE 6. CARD

Column Name

Data Type

Description

ADMINSTATE

FK

Administrative state Foreign Key

ASSET

varchar

Asset number

CARD

FK

Card Foreign Key

CARDTYPE

FK

Card type Foreign Key

COMMISSIONDATE

datetime

Commission date

CONTRACT

FK

Contract Foreign Key

DEPRECIATION_RATE

float

Depreciation rate

DESCRIPTION

varchar

Description of this card

FIXED_RECUR_COST

float

Fixed recurring costs

ID

int PK

Auto-generated Primary Key

INSTALLDATE

datetime

Install date

INSTALL_COST

float

Install cost

INUSEBY

FK

Entity Foreign Key

MAINTAINER

FK

Entity Foreign Key

MANUFACTURER

FK

Entity Foreign Key

NAME

varchar

Name for this connector

OPSTATE

FK

Operating state Foreign Key

OVERSION

version

Auto-maintained version number

PURCHASEDATE

datetime

Purchase date

PURCHASE_COST

float

Purchase cost

SERIAL

varchar

Serial number

SLOT

FK

Slot Foreign Key

SUPPLIER

FK

Entity Foreign Key

TRACKING

varchar

Tracking number

VAR_RECUR_COST

float

Variable recurring costs

3.7 CARDTYPE

Describes a card type

TABLE 7. CARDTYPE

Column Name

Data Type

Description

DESCRIPTION

varchar

Description of this card type

ID

int PK

Auto-generated Primary Key

NAME

varchar

Name for this card type

OVERSION

version

Auto-maintained version number

3.8 CONNECTOR

Describes a connector.

TABLE 8. CONNECTOR

Column Name

Data Type

Description

CONNECTORTYPE

FK

Connector type Foreign Key

DESCRIPTION

varchar

Description of this connector

DEVICE

FK

Device Foreign Key

ID

int PK

Auto-generated Primary Key

LINK_A

FK

Link A Foreign Key

LINK_B

FK

Link B Foreign Key

NAME

varchar

Name for this connector

OVERSION

version

Auto-maintained version number

3.9 CONNECTORTYPE

Describes a connector type.

TABLE 9. CONNECTORTYPE

Column Name

Data Type

Description

DESCRIPTION

varchar

Description of this connector type

ID

int PK

Auto-generated Primary Key

NAME

varchar

Name for this connector type

OVERSION

version

Auto-maintained version number

3.10 CONTRACT

Describes a contract.

TABLE 10. CONTRACT

Column Name

Data Type

Description

BEGINDATE

datetime

Date this contract begins

CONTRACT

FK

Parent contract (if this is a subcontract)

CONTRACTID

varchar

Identifier for this contract

CONTRACTSTATE

FK

Contract state Foreign Key

CONTRACTTYPE

FK

Contract type Foreign Key

COST

float

Cost of this contract

DESCRIPTION

varchar

Description of this contract

ENDDATE

datetime

Date this contract ends

ID

int PK

Auto-generated Primary Key

NAME

varchar

Name for this connector

OVERSION

version

Auto-maintained version number

RENEWDATE

datetime

Date this contract is to be renewed

SUPPLIER

FK

Supplier Foreign Key

3.11 CONTRACTSTATE

Describes a contract state.

TABLE 11. CONTRACTSTATE

Column Name

Data Type

Description

DESCRIPTION

varchar

Description of this contract state

ID

int PK

Auto-generated Primary Key

NAME

varchar

Name for this contract state

OVERSION

version

Auto-maintained version number

3.12 CONTRACTTYPE

Describes a contract type.

TABLE 12. CONTRACTTYPE

Column Name

Data Type

Description

DESCRIPTION

varchar

Description of this contract type

ID

int PK

Auto-generated Primary Key

NAME

varchar

Name for this contract type

OVERSION

version

Auto-maintained version number

3.13 CURRENT_NETSUSER

Describes the current Nets user.

TABLE 13. CURRENT_NETSUSER

Column Name

Data Type

Description

EXPIRES

datetime

Date this user expires

HOSTNAME

varchar

The hostname where this user is

LOGGED_IN

datetime

When the user logged in

OVERSION

version

Auto-maintained version number

PID

int

Process ID for this user

USER_ID

FK

User Foreign Key

3.14 DEVICE

Describes the characteristics of a device.

TABLE 14. DEVICE

Column Name

Data Type

Description

ADMININTERFACE

FK

Interface Foreign Key

ADMINSTATE

FK

Administrative state Foreign Key

ASSET

varchar

Asset number

COMMISSIONDATE

datetime

Commission date

CONTRACT

FK

Contract Foreign Key

DEPRECIATION_RATE

float

Depreciation rate

DESCRIPTION

varchar

Description

DEVICEROLE

FK

Device role Foreign Key

DEVICETYPE

FK

Device type Foreign Key

FIXED_RECUR_COST

float

Fixed recurring costs

ID

int PK

Auto-generated Primary Key

INSTALLDATE

datetime

Install date

INSTALL_COST

float

Installation cost

INTERNALTO

FK

Device Foreign Key

INUSEBY

FK

Entity Foreign Key

LOCATION

FK

Location Foreign Key

MAINTAINER

FK

Entity Foreign Key

MANUFACTURER

FK

Entity Foreign Key

NAME

varchar

Name

OPSTATE

FK

OpState Foreign Key

OVERSION

version

Auto-maintained version number

PURCHASEDATE

datetime

Purchase date

PURCHASE_COST

float

Purchase cost

RACK

FK

Rack Foreign Key

RACK_HEIGHT

int

Rack height

RACK_POS

int

Rack position

SERIAL

varchar

Serial number

SUPPLIER

FK

Entity Foreign Key

TRACKING

varchar

Tracking number

VAR_RECUR_COST

float

Variable recurring costs

VOLTS

int

Volts

WATTS

int

Watts

3.15 DEVICEROLE

Define a Device Role.

TABLE 15. DEVICEROLE

Column Name

Data Type

Description

DESCRIPTION

varchar

Description of this device role

ID

int PK

Auto-generated Primary Key

NAME

varchar

Name of this device role

OVERSION

version

Auto-maintained version number

 

3.16 DEVICETYPE

Define a Device Type.

TABLE 16. DEVICETYPE

Column Name

Data Type

Description

DESCRIPTION

varchar

Description of this device type

ID

int PK

Auto-generated Primary Key

NAME

varchar

Name of this device type

OVERSION

version

Auto-maintained version number

3.17 DOBJ

Describes a drawing object: an icon, line etc that appears on a drawing.

TABLE 17. DOBJ

Column Name

Data Type

Description

DESCRIPTION

varchar

Description of this drawing object

DRAWING

FK

Drawing this object is on Foreign Key

FG_COL

varchar

Foreground colour

FONT

varchar

Font used for text

FORMAT

varchar

Format of text

ICON

FK

Icon used for this object Foreign Key

ID

int PK

Auto-generated Primary Key

OBJECTTYPE

FK

Object type Foreign Key

OBJ_ID

int

Object ID of the object referred to

OVERSION

version

Auto-maintained version number

STYLE

int

Style used for text

X1

int

Screen co-ordinates

X2

int

Screen co-ordinates

Y1

int

Screen co-ordinates

Y2

int

Screen co-ordinates

3.18 DRAWING

Describes a drawing.

TABLE 18. DRAWING

Column Name

Data Type

Description

BG_COL

varchar

Background colour

DESCRIPTION

varchar

Description of this drawing

FILENAME

varchar

Filename of the file containing the drawing (optional)

ID

int PK

Auto-generated Primary Key

LRLATITUDE

float

Lower right latitiude

LRLONGITUDE

float

Lower right longitude

NAME

varchar

Name of this drawing

OVERSION

version

Auto-maintained version number

ULLATITUDE

float

Upper left latitude

ULLONGITUDE

float

Upper left longitude

3.19 ENTITY

Describes a legal entity like a person, company, organisation, etc.

TABLE 19. ENTITY

Column Name

Data Type

Description

EMAIL_ADDRESS

varchar

Email address for the person, serviece or organisation

FOREIGN_KEY

int

Foreign key into some other system

ID

int PK

Auto-generated Primary Key

LOCATION

FK

Location Foreign Key

MOBILEPHONE

varchar

Mobile phone number

NAME

varchar

Name of this entity

OVERSION

version

Auto-maintained version number

PHONE

varchar

Phone number

TEMPLOCATION

FK

Temporary location Foreign Key

3.20 EVENT

Describes an event. Used to record Update history, Fault history etc. This table could become very large.

TABLE 20. EVENT

Column Name

Data Type

Description

BY_WHO

varchar

User who caused the event

DESCRIPTION

varchar

Description of this event

EVENTTYPE

FK

Event type Foreign Key

ID

int PK

Auto-generated Primary Key

OBJECTID

int

 

OBJECTTYPE

FK

 

OCCURRED

datetime

When this event occurred

OVERSION

version

Auto-maintained version number

3.21 EVENTTYPE

Defines the set of available event types.

TABLE 21. EVENTTYPE

Column Name

Data Type

Description

ID

int PK

Auto-generated Primary Key

NAME

varchar

Name of this event type

OVERSION

version

Auto-maintained version number

3.22 INTERFACE

Defines an Interface: the part of a Device that connects to a Link.

TABLE 22. INTERFACE

Column Name

Data Type

Description

ADDRESS

FK

Address Foreign Key

ADMINSTATE

FK

Administrative state Foreign Key

ASSET

varchar

Asset number

CARD

FK

Card Foreign Key

COMMISSIONDATE

datetime

Date commissioned

CONNECTORTYPE

FK

Connector type Foreign Key

CONTRACT

FK

Contract Foreign Key

DEPRECIATION_RATE

float

Depreciation rate

DESCRIPTION

varchar

Description of this interface

DEVICE

FK

Device Foreign Key

FIXED_RECUR_COST

float

Fixed recurring costs

ID

int PK

Auto-generated Primary Key

INSTALLDATE

datetime

Date installed

INSTALL_COST

float

Installation cost

INTERFACETYPE

FK

Interface type Foreign Key

INTERNALTO

FK

Sub-interface parent

INUSEBY

FK

Entity Foreign Key

LINK

FK

Link Foreign Key

MACADDRESS

varchar

MAC address (optional)

MAINTAINER

FK

Entity Foreign Key

MANUFACTURER

FK

Entity Foreign Key

NAME

varchar

Name of this interface

OPSTATE

FK

Operational state Foreign Key

OVERSION

version

Auto-maintained version number

PURCHASEDATE

datetime

Date purchased

PURCHASE_COST

float

Purchase cost

SERIAL

varchar

Serial number

SUPPLIER

FK

Entity Foreign Key

TRACKING

varchar

Tracking number

VAR_RECUR_COST

float

Variable recurring costs

3.23 INTERFACETYPE

Defines an Interface type.

TABLE 23. INTERFACETYPE

Column Name

Data Type

Description

DESCRIPTION

varchar

Description of this interface type

ID

int PK

Auto-generated Primary Key

NAME

varchar

Name eg Ethernet, TR, FDDI, Serial, ISDN etc

OVERSION

version

Auto-maintained version number

3.24 LINK

Defines a point-to-point or multipoint communications link. A Link is a communications medium connecting to 0 or more Interfaces.

TABLE 24. LINK

Column Name

Data Type

Description

ADMINSTATE

FK

Administrative state Foreign Key

BANDWIDTH

FK

Bandwidth Foreign Key

BUNDLE

FK

Bundle Foreign Key

CIRCUIT

varchar

Circuit identifier

COMMISSIONDATE

datetime

Date commissioned

CONTRACT

FK

Contract Foreign Key

DEPRECIATION_RATE

float

Depreciation rate

DESCRIPTION

varchar

Description of this link

FIXED_RECUR_COST

float

Fixed recurring costs

ID

int PK

Auto-generated Primary Key

INSTALLDATE

datetime

Date installed

INSTALL_COST

float

Installation cost

INUSEBY

FK

Entity Foreign Key

LINK

FK

Virtual circuit parent

LINKTYPE

FK

Link type Foreign Key

MAINTAINER

FK

Entity Foreign Key

MANUFACTURER

FK

Entity Foreign Key

NAME

varchar

Name of this link

OPSTATE

FK

Operational state Foreign Key

OVERSION

version

Auto-maintained version number

PURCHASEDATE

datetime

Date purchased

PURCHASE_COST

float

Purchase cost

SUPPLIER

FK

Entity Foreign Key

VAR_RECUR_COST

float

Variable recurring costs

3.25 LINKTYPE

Defines the types of links available.

TABLE 25. LINKTYPE

Column Name

Data Type

Description

DESCRIPTION

varchar

Description of this link type

ID

int PK

Auto-generated Primary Key

NAME

varchar

Name - eg. Ethernet, Leased Line, ISDN, FR etc

OVERSION

version

Auto-maintained version number

3.26 LOCATION

This object defines a physical location.

TABLE 26. LOCATION

Column Name

Data Type

Description

ADDRESS1

varchar

Address line 1

ADDRESS2

varchar

Address line 2

CITY

varchar

City

CONTACT

FK

Entity Foreign Key

CONTRACT

FK

Contract Foreign Key

COUNTRY

varchar

Country

DESCRIPTION

varchar

Description of this location

ID

int PK

Auto-generated Primary Key

LATITUDE

float

Latitude for map co-ordinates

LONGITUDE

float

Longitude for map co-ordinates

NAME

varchar

Name of this location

OVERSION

version

Auto-maintained version number

POSTCODE

varchar

Postcode

SITE

varchar

Site

STATE

varchar

State, province, department, etc.

3.27 NETSUSER

Defines the users who are authorised to use Nets.

TABLE 27. NETSUSER

Column Name

Data Type

Description

DESCRIPTION

varchar

Description of this user

EMAIL_ADDRESS

varchar

User's email address

FULL_NAME

varchar

User's full name

ID

int PK

Auto-generated Primary Key

LOCATION

FK

Location Foreign Key

MOBILE_PHONE

varchar

User's mobile phone number

NAME

varchar

Name of this user in the system

OVERSION

version

Auto-maintained version number

PHONE

varchar

User's phone number

USER_PASSWORD

varchar

User's password

3.28 NOTE

Describes the Note objects used throughout the system.

TABLE 28. NOTE

Column Name

Data Type

Description

BY_WHO

varchar

User who created this note

ID

int PK

Auto-generated Primary Key

NOTE

varchar

Contents of this note

OBJECTID

int

Object number this note attaches to

OBJECTTYPE

FK

Object type Foreign Key

OCCURRED

datetime

When this note was created

OVERSION

version

Auto-maintained version number

3.29 OBJECTTYPE

Defines all the tables in this database. This is meta-data. There is one entry for each table in the database (including itself!)Its mostly used as a foreign key for ObjectExtension, to define what table the object being extended is in.

TABLE 29. OBJECTTYPE

Column Name

Data Type

Description

CURR_ID

int

Current identifier for this object type

ID

int PK

Auto-generated Primary Key

NAME

varchar

Name of this object type

3.30 OPSTATE

Defines the operational states for the system.

TABLE 30. OPSTATE

Column Name

Data Type

Description

DESCRIPTION

varchar

Description of this operational state

ID

int PK

Auto-generated Primary Key

NAME

varchar

Name of this operational state

OVERSION

version

Auto-maintained version number

3.31 PACKAGE

Describes the Nets packages installed in the system.

TABLE 31. PACKAGE

Column Name

Data Type

Description

DESCRIPTION

varchar

Description of this package

ID

int PK

Auto-generated Primary Key

NAME

varchar

Name of this package

OCCURRED

datetime

When the package was installed

OVERSION

version

Auto-maintained version number

REVISION

varchar

Revision of this package

VENDOR

varchar

Vendor of this package

3.32 PERMISSION

Defines the available Nets user permissions.

TABLE 32. PERMISSION

Column Name

Data Type

Description

DESCRIPTION

varchar

Description of this permission

HELP

varchar

Help text

ID

int PK

Auto-generated Primary Key

NAME

varchar

Name of this permission

OVERSION

version

Auto-maintained version number

PROMPT

varchar

Prompt text

3.33 PREFERENCE

Defines the available Nets user preferences.

TABLE 33. PREFERENCE

Column Name

Data Type

Description

DATATYPE

int

Not used yet

DESCRIPTION

varchar

Description of this preference

HELP

varchar

Help text

ID

int PK

Auto-generated Primary Key

NAME

varchar

Name of this permission

OVERSION

version

Auto-maintained version number

PROMPT

varchar

Prompt text

3.34 RACK

Describes the racks in use.

TABLE 34. RACK

Column Name

Data Type

Description

DEPTH

int

Depth of this rack

DESCRIPTION

varchar

Description of this rack

HEIGHT

int

Height of this rack

ID

int PK

Auto-generated Primary Key

LOCATION

FK

Location Foreign Key

NAME

varchar

Name of this rack

OVERSION

version

Auto-maintained version number

POWER

varchar

Available supply voltages in this rack

WIDTH

int

Width of this rack

3.35 REPORT

Describes a report that can be run to extract data from the database.

TABLE 35. REPORT

Column Name

Data Type

Description

DESCRIPTION

varchar

Description of this report

FORMAT

varchar

Format for this report

HELP

varchar

Help text

ID

int PK

Auto-generated Primary Key

NAME

varchar

Name of this report

OPTIONS

varchar

Options for this report

OVERSION

version

Auto-maintained version number

QUERY

varchar

SQL query for this report

3.36 SLOT

Describes a slot in a device.

TABLE 36. SLOT

Column Name

Data Type

Description

DESCRIPTION

varchar

Description of this slot

DEVICE

FK

Device this slot is in Foreign Key

ID

int PK

Auto-generated Primary Key

NAME

varchar

Name of this slot

OVERSION

version

Auto-maintained version number

SLOTTYPE

FK

Slot type Foreign Key

3.37 SLOTTYPE

Describes a slot type.

TABLE 37. SLOTTYPE

Column Name

Data Type

Description

DESCRIPTION

varchar

Description of this slot type

ID

int PK

Auto-generated Primary Key

NAME

varchar

Name of this slot type

OVERSION

version

Auto-maintained version number

3.38 SOFTWARE

Describes the software installed on a device.

TABLE 38. SOFTWARE

Column Name

Data Type

Description

CONFIGURATION

varchar

Configuration file for this software

DESCRIPTION

varchar

Description of this software

DEVICE

FK

Device this software runs on Foreign Key

ID

int PK

Auto-generated Primary Key

INTERFACE

FK

Interface for this software Foreign Key

NAME

varchar

Name of this software

OVERSION

version

Auto-maintained version number

PORTNUMBER

int

Port number used by this software

PORTTYPE

int

Port type used by this software

REVISION

varchar

Revision of this software

SOFTWARETYPE

FK

Software type Foreign Key

3.39 SOFTWARETYPE

Defines the types of software in use.

TABLE 39. SOFTWARETYPE

Column Name

Data Type

Description

DESCRIPTION

varchar

Description of this software type

ID

int PK

Auto-generated Primary Key

NAME

varchar

Name of this software type

OVERSION

version

Auto-maintained version number

3.40 TEMPLATE

Describes a template for creating multiple objects in the database.

TABLE 40. TEMPLATE

Column Name

Data Type

Description

DESCRIPTION

varchar

Description of this template

FILENAME

varchar

Filename of the file containing the template

ID

int PK

Auto-generated Primary Key

NAME

varchar

Name of this template

OVERSION

version

Auto-maintained version number

3.41 USER_PERM

Defines a user's permissions.

TABLE 41. USER_PERM

Column Name

Data Type

Description

PERM_NAME

varchar

User permission

USER_ID

FK

User Foreign Key

3.42 USER_PREF

Defines a user's preferences.

TABLE 42. USER_PREF

Column Name

Data Type

Description

PREF_NAME

varchar

User preference name

PREF_VALUE

varchar

User preference value

USER_ID

FK

User Foreign Key

3.43 USER_SESSION

Defines a user's session, their standard set of windows, sizes, positions etc

TABLE 43. USER_SESSION7

Column Name

Data Type

Description

SESSION_DESC

varchar

User's session description

USER_ID

FK

User Foreign Key

3.44 Yet to be defined

TroubleTicket, Alarm, Statistics, Configuration File, Routing Domain etc.