1 |
rodolico |
1 |
create table network_connection (
|
|
|
2 |
network_connection_id int unsigned not null auto-increment,
|
|
|
3 |
connector_id varchar(20) default null comment 'Use this to put things like cable number',
|
|
|
4 |
source_device int unsigned not null comment 'ID of the source device',
|
|
|
5 |
source_port varchar(20) comment 'Things like eth0, or port 1 for switches',
|
|
|
6 |
target_device int unsigned not null comment 'ID of target device',
|
|
|
7 |
target_port varchar(20) comment 'Things like eth0, or port 1 for switches',
|
|
|
8 |
created_date datetime,
|
|
|
9 |
removed_date datetime,
|
|
|
10 |
primary key (network_connection_id)
|
|
|
11 |
) comment 'Stores information about network connections between devices';
|
|
|
12 |
|
|
|
13 |
|
90 |
rodolico |
14 |
insert into network_connection select null,'Cable 09',
|
|
|
15 |
|
|
|
16 |
|
|
|
17 |
create table network (
|
|
|
18 |
network_id int unsigned not null auto_increment,
|
|
|
19 |
device_1 int unsigned not null references device(device_id),
|
|
|
20 |
port_1 varchar(16) comment 'Port it is plugged into',
|
|
|
21 |
device_2 int unsigned not null references device(device_id),
|
|
|
22 |
port_2 varchar(16) comment 'Port it is plugged into',
|
|
|
23 |
connector int unsigned references connectors(connector_id)
|
|
|
24 |
primary key (network_id)
|
|
|
25 |
);
|
|
|
26 |
|
|
|
27 |
create table connectors (
|
|
|
28 |
connectors_id int unsigned not null auto_increment,
|
|
|
29 |
cable varchar(16),
|
|
|
30 |
markings varchar(16),
|
|
|
31 |
primary key (connectors_id)
|
|
|
32 |
);
|