]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#90] Minor cleanup
authorTomek Mrugalski <tomek@isc.org>
Mon, 17 May 2021 16:28:21 +0000 (18:28 +0200)
committerTomek Mrugalski <tomek@isc.org>
Thu, 28 Oct 2021 10:31:40 +0000 (12:31 +0200)
src/share/database/scripts/pgsql/upgrade_6.2_to_7.0.sh.in

index adb71bf0aa88b53c17c8af83abb6622dddfdaf8b..1453b8700b035f4908829e8712569e4238148512 100644 (file)
@@ -45,6 +45,8 @@ CREATE TABLE modification (
 );
 INSERT INTO modification VALUES (0,'create'), (1,'update'), (2,'delete');
 
+
+
 -- Now create the table that holds different parameter data types.
 CREATE TABLE parameter_data_type (
   id smallint NOT NULL,
@@ -54,15 +56,6 @@ CREATE TABLE parameter_data_type (
 INSERT INTO parameter_data_type VALUES (0,'integer'),(1,'real'),(2,'boolean'),(4,'string');
 
 
-DROP TABLE IF EXISTS `dhcp6_server`;
-CREATE TABLE dhcp6_server (
-  id SERIAL PRIMARY KEY NOT NULL,
-  tag varchar(256) UNIQUE NOT NULL,
-  description text DEFAULT NULL,
-  modification_ts timestamp NOT NULL DEFAULT Ccurrent_timestamp() ON UPDATE current_timestamp(),
-  KEY key_dhcp6_server_modification_ts (modification_ts)
-);
-
 
 DROP TABLE IF EXISTS dhcp6_server;
 CREATE TABLE dhcp6_server (
@@ -72,7 +65,6 @@ CREATE TABLE dhcp6_server (
   modification_ts timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
   UNIQUE(tag)
 );
-
 CREATE INDEX dhcp6_server_modification_ts ON dhcp6_server (modification_ts);
 
 -- Adding on update trigger in MySQL is as easy as using this column definition in CREATE TABLE:
@@ -90,7 +82,12 @@ CREATE OR REPLACE FUNCTION dhcp6_server_modification_ts_update()
 $dhcp6_server_modification_ts_update$ LANGUAGE plpgsql;
 
 -- Finally, we need to create a trigger that will kick off this function.
-CREATE TRIGGER dhcp6_server_modification_ts_update AFTER UPDATE ON dhcp6_server FOR EACH ROW EXECUTE PROCEDURE dhcp6_server_modification_ts_update();
+CREATE TRIGGER dhcp6_server_modification_ts_update
+  AFTER UPDATE ON dhcp6_server
+  FOR EACH ROW EXECUTE PROCEDURE dhcp6_server_modification_ts_update();
+
+
+
 
 
 -- Update the schema version number