Last active
September 6, 2021 14:52
-
-
Save tjlee/8a832e91a95d65caa651f47dd399e689 to your computer and use it in GitHub Desktop.
Nodes sample DDL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create type node_type as enum ( | |
'' | |
); | |
create table node ( | |
node_id serial primary key not null, | |
network cidr not null, | |
mac macaddr, | |
ip_addr inet not null, | |
serial_number varchar(50), | |
node node_type, | |
up_link varchar(50), | |
down_link varchar(50), | |
up_node_id int); | |
alter table node | |
add constraint node_to_upnode | |
foreign key (up_node_id) references node (node_id); | |
create table node_description ( | |
node_id int, | |
hostname varchar(64), | |
station varchar(50), | |
vendor_id int, | |
model_id int, | |
location_id int, | |
address varchar(256), | |
client_id int, | |
description varchar(256)); | |
alter table node_description | |
add constraint node_to_node_details | |
foreign key (node_id) references node (node_id); | |
create index node_description_node_id_index | |
on node_description (node_id); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment