X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=samples%2Fdnsguard%2Fsrc%2Fmain%2Fresources%2Fdatabase.sql;h=f9032b89471851e81631c854dc88a07a3a49c644;hb=d6ca4980c8390fb6e004501d1a7f037bb8081558;hp=a14147ee4578b250c7c3e9744b8a5ec592bce2f7;hpb=b7f3d712a6c122b7d6ce15e98b8fb705b7bfd8ba;p=toolkit.git diff --git a/samples/dnsguard/src/main/resources/database.sql b/samples/dnsguard/src/main/resources/database.sql index a14147e..f9032b8 100644 --- a/samples/dnsguard/src/main/resources/database.sql +++ b/samples/dnsguard/src/main/resources/database.sql @@ -1,27 +1,22 @@ CREATE TABLE IF NOT EXISTS bulkreply ( - idbulkreply int(11) NOT NULL AUTO_INCREMENT, - request varchar(255) DEFAULT NULL, - type int(11) DEFAULT NULL, - ttl int(11) DEFAULT NULL, - len int(11) DEFAULT NULL, - data varchar(255) DEFAULT NULL, - ip_src varchar(16) DEFAULT NULL, - ip_dst varchar(16) DEFAULT NULL, - udp_src int(11) DEFAULT NULL, - udp_dst int(11) DEFAULT NULL, - tstamp timestamp NULL DEFAULT NULL, - PRIMARY KEY (idbulkreply) -) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; + idbulkreply INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, + request varchar(255), + type int, + ttl int, + len int, + data varchar(255), + ip_src varchar(16), + ip_dst varchar(16), + udp_src int, + udp_dst int, + tstamp timestamp +); CREATE TABLE IF NOT EXISTS config ( - idconfig int(11) NOT NULL AUTO_INCREMENT, - configname varchar(16) DEFAULT NULL, - configval varchar(16) DEFAULT NULL, - PRIMARY KEY (idconfig) -) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; + idconfig INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, + configname varchar(16), + configval varchar(16) +); - -INSERT INTO config (configname, configval) -SELECT 'localdns', '192.168.0.1' - FROM dual - WHERE NOT EXISTS (SELECT 1 FROM config WHERE configname = 'localdns'); +INSERT INTO config (idconfig, configname, configval) +values(1, 'localdns', '192.168.0.1' );