You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2022/05/16 19:34:51 UTC

[GitHub] [trafficcontrol] ocket8888 commented on a diff in pull request #6802: Squash database migrations

ocket8888 commented on code in PR #6802:
URL: https://github.com/apache/trafficcontrol/pull/6802#discussion_r874088422


##########
traffic_ops/app/db/create_tables.sql:
##########
@@ -143,6 +143,42 @@ LANGUAGE plpgsql;
 
 ALTER FUNCTION public.on_delete_current_timestamp_last_updated() OWNER TO traffic_ops;
 
+--
+-- Name: update_ds_timestamp_on_insert(); Type: FUNCTION; Schema: public; Owner: traffic_ops
+--
+
+CREATE OR REPLACE FUNCTION update_ds_timestamp_on_insert()
+    RETURNS trigger
+    AS $$
+BEGIN
+    UPDATE deliveryservice
+    SET last_updated=now()
+    WHERE id IN (
+        SELECT deliveryservice
+        FROM CAST(NEW AS deliveryservice_tls_version)
+    );
+    RETURN NULL;

Review Comment:
   real indentation > spaces
   
   but the rest of `create_tables.sql` is fake-indented, so it's consistent.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org