mitchell852 closed pull request #2688: ensure use_tenancy set to 1 rather than
deleting the parameter
URL: https://github.com/apache/trafficcontrol/pull/2688
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 b7d892d1a..9f1274087 100644
--- a/traffic_ops/app/db/patches.sql
+++ b/traffic_ops/app/db/patches.sql
@@ -70,8 +70,9 @@ $tenantnotnull$;
ALTER TABLE tm_user ALTER COLUMN tenant_id SET NOT NULL;
ALTER TABLE deliveryservice ALTER COLUMN tenant_id SET NOT NULL;
ALTER TABLE origin ALTER COLUMN tenant SET NOT NULL;
--- get rid of the use_tenancy flag
-DELETE FROM parameter WHERE name = 'use_tenancy' AND config_file = 'global';
+-- set use_tenancy to 1 -- this should remain until code that depends on it is
removed from both TO and TP
+-- NOTE that we know use_tenancy exists b/c it's inserted in seeds.sql
+UPDATE parameter SET value = '1' WHERE name = 'use_tenancy' AND config_file =
'global';
-- never allow deep_caching_type to be NULL
UPDATE deliveryservice SET deep_caching_type = 'NEVER' WHERE deep_caching_type
IS NULL;
diff --git a/traffic_ops/app/db/seeds.sql b/traffic_ops/app/db/seeds.sql
index 3bf138e66..c3b3e780e 100644
--- a/traffic_ops/app/db/seeds.sql
+++ b/traffic_ops/app/db/seeds.sql
@@ -45,8 +45,8 @@ BEGIN
insert into profile_parameter (profile, parameter) values (
(select id from profile where name = 'GLOBAL'), (select id from parameter where
name = 'tm.toolname' and config_file = 'global' and value = 'Traffic Ops') ) ON
CONFLICT (profile, parameter) DO NOTHING;
END IF;
IF NOT EXISTS (SELECT id FROM PARAMETER WHERE name = 'use_tenancy' AND
config_file = 'global') THEN
- insert into parameter (name, config_file, value) values
('use_tenancy', 'global', '0');
- insert into profile_parameter (profile, parameter) values (
(select id from profile where name = 'GLOBAL'), (select id from parameter where
name = 'use_tenancy' and config_file = 'global' and value = '0') ) ON CONFLICT
(profile, parameter) DO NOTHING;
+ insert into parameter (name, config_file, value) values
('use_tenancy', 'global', '1');
+ insert into profile_parameter (profile, parameter) values (
(select id from profile where name = 'GLOBAL'), (select id from parameter where
name = 'use_tenancy' and config_file = 'global' and value = '1') ) ON CONFLICT
(profile, parameter) DO NOTHING;
END IF;
END
$do$;
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services