dangogh closed pull request #2719: Traffic Ops - Constraint violation(s) with 
Traffic Ops postinstall script
URL: https://github.com/apache/trafficcontrol/pull/2719
 
 
   

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/install/bin/_postinstall 
b/traffic_ops/install/bin/_postinstall
index 1ca741104..586855d54 100755
--- a/traffic_ops/install/bin/_postinstall
+++ b/traffic_ops/install/bin/_postinstall
@@ -617,8 +617,9 @@ QUERY
     # Skip the insert if the admin 'username' is already there.
     my $hashed_passwd = hash_pass( $adminconf->{"password"} );
     my $insert_admin = <<"ADMIN";
-    insert into tm_user (username, role, local_passwd, confirm_local_passwd)
+    insert into tm_user (username, tenant_id, role, local_passwd, 
confirm_local_passwd)
                 values  ('$adminconf->{"username"}',
+                        (select id from tenant where name = 'root'),
                         (select id from role where name = 'admin'),
                          '$hashed_passwd',
                         '$hashed_passwd' )
@@ -772,8 +773,8 @@ sub insert_profiles {
     my $insert_stmt = <<INSERTS;
 
     -- global parameters
-    insert into profile (name, description, type) 
-                values ('GLOBAL', 'Global Traffic Ops profile, DO NOT DELETE', 
'UNK_PROFILE') 
+    insert into profile (name, description, type, cdn) 
+                values ('GLOBAL', 'Global Traffic Ops profile, DO NOT DELETE', 
'UNK_PROFILE',  (SELECT id FROM cdn WHERE name='ALL')) 
                 ON CONFLICT (name) DO NOTHING;
 
     insert into profile_parameter (profile, parameter) 


 

----------------------------------------------------------------
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

Reply via email to