OLD | NEW |
---|---|
1 -- Copyright 2016 The Chromium Authors. All Rights Reserved. | 1 -- Copyright 2016 The Chromium Authors. All Rights Reserved. |
2 -- | 2 -- |
3 -- Use of this source code is governed by a BSD-style | 3 -- Use of this source code is governed by a BSD-style |
4 -- license that can be found in the LICENSE file or at | 4 -- license that can be found in the LICENSE file or at |
5 -- https://developers.google.com/open-source/licenses/bsd | 5 -- https://developers.google.com/open-source/licenses/bsd |
6 | 6 |
7 -- Create tables in the crimson DB. | 7 -- Create tables in the crimson DB. |
8 | 8 |
9 CREATE TABLE ip_range ( | 9 CREATE TABLE ip_range ( |
10 site varchar(20) NOT NULL, | 10 site varchar(20) NOT NULL, |
sheyang
2016/07/01 21:55:26
Is this a PK?
pgervais
2016/07/01 22:26:36
It will be part of it (in another CL).
| |
11 vlan varchar(20), | 11 vlan varchar(20), |
12 start_ip varchar(34) NOT NULL, | 12 start_ip varchar(34) NOT NULL, |
13 end_ip varchar(34) NOT NULL | 13 end_ip varchar(34) NOT NULL |
14 ) ENGINE=INNODB; | 14 ) ENGINE=INNODB; |
15 | 15 |
16 CREATE index ip_range_start_ip_idx ON ip_range(start_ip); | |
sheyang
2016/07/01 21:55:26
The purpose of index start_ip and end_ip is for qu
pgervais
2016/07/01 22:26:36
That's correct.
| |
17 CREATE index ip_ragne_start_ip_idx ON ip_range(end_ip); | |
18 | |
16 CREATE TABLE host ( | 19 CREATE TABLE host ( |
17 site varchar(20) NOT NULL, | 20 site varchar(20) NOT NULL, |
sheyang
2016/07/01 21:55:26
Is this a FK?
pgervais
2016/07/01 22:26:36
It looks like a foreign key but it's not. There is
| |
18 hostname varchar(63) NOT NULL, | 21 hostname varchar(63) NOT NULL, |
19 mac_addr varchar(14) NOT NULL, | 22 mac_addr varchar(14) NOT NULL, |
20 ip varchar(34) NOT NULL, | 23 ip varchar(34) NOT NULL, |
21 boot_class varchar(20), | 24 boot_class varchar(20), |
22 PRIMARY KEY (mac_addr) | 25 PRIMARY KEY (mac_addr) |
23 ) ENGINE=INNODB; | 26 ) ENGINE=INNODB; |
27 | |
28 CREATE index host_site_hostname_idx ON host(site, hostname); | |
29 CREATE index host_site_ip_idx ON host(site, ip); | |
OLD | NEW |