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 2018/07/16 22:33:56 UTC

[GitHub] dangogh closed pull request #2547: TO DB: update boolean fields and add NOT NULL constraints

dangogh closed pull request #2547: TO DB: update boolean fields and add NOT NULL constraints
URL: https://github.com/apache/trafficcontrol/pull/2547
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/traffic_ops/app/db/patches.sql b/traffic_ops/app/db/patches.sql
index 6fe87d15e..362e8b266 100644
--- a/traffic_ops/app/db/patches.sql
+++ b/traffic_ops/app/db/patches.sql
@@ -39,3 +39,25 @@ ALTER TABLE deliveryservice ADD CONSTRAINT routing_name_not_empty CHECK (length(
 -- altering any enum values within a transaction block and by default
 -- goose runs migrations within a transaction.
 ALTER TYPE profile_type ADD VALUE IF NOT EXISTS 'GROVE_PROFILE';
+
+-- not enough to make boolean default false -- enforce that API can't set it to NULL
+UPDATE cachegroup
+    SET fallback_to_closest = true WHERE fallback_to_closest IS NULL;
+ALTER TABLE cachegroup
+    ALTER COLUMN fallback_to_closest SET NOT NULL;
+UPDATE deliveryservice
+    SET ipv6_routing_enabled = false WHERE ipv6_routing_enabled IS NULL;
+UPDATE deliveryservice
+    SET multi_site_origin = false WHERE multi_site_origin IS NULL;
+UPDATE deliveryservice
+    SET regional_geo_blocking = false WHERE regional_geo_blocking IS NULL;
+UPDATE deliveryservice
+    SET logs_enabled = false WHERE logs_enabled IS NULL;
+UPDATE deliveryservice
+    SET anonymous_blocking_enabled = false WHERE anonymous_blocking_enabled IS NULL;
+ALTER TABLE deliveryservice
+    ALTER COLUMN ipv6_routing_enabled SET NOT NULL,
+    ALTER COLUMN multi_site_origin SET NOT NULL,
+    ALTER COLUMN regional_geo_blocking SET NOT NULL,
+    ALTER COLUMN logs_enabled SET NOT NULL,
+    ALTER COLUMN anonymous_blocking_enabled SET NOT NULL;


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services