This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 897397446456a24bb07223de92b4d6e508676342
Author: Jesse Rivas <jesse_ri...@comcast.com>
AuthorDate: Tue Jan 30 14:46:49 2018 -0700

    migration .sql for updating client steering deliveryservices with response 
headers of subordinate deliveryservices. Fixes #986
---
 ...180130000000_update_client_steering_headers.sql | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git 
a/traffic_ops/app/db/migrations/20180130000000_update_client_steering_headers.sql
 
b/traffic_ops/app/db/migrations/20180130000000_update_client_steering_headers.sql
new file mode 100644
index 0000000..ef233c1
--- /dev/null
+++ 
b/traffic_ops/app/db/migrations/20180130000000_update_client_steering_headers.sql
@@ -0,0 +1,28 @@
+/*
+       Licensed under the Apache License, Version 2.0 (the "License");
+       you may not use this file except in compliance with the License.
+       You may obtain a copy of the License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing, software
+       distributed under the License is distributed on an "AS IS" BASIS,
+       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+       See the License for the specific language governing permissions and
+       limitations under the License.
+*/
+
+-- +goose Up
+-- SQL in section 'Up' is executed when this migration is applied
+UPDATE deliveryservice
+SET tr_response_headers = subquery.tr_response_headers
+FROM (SELECT ds.id, ds.tr_response_headers, st.deliveryservice
+  FROM deliveryservice ds JOIN steering_target st ON ds.id = st.target
+  WHERE ds.tr_response_headers IS NOT NULL)
+AS subquery
+  WHERE subquery.deliveryservice = deliveryservice.id
+  AND type = (SELECT id from type where name = 'CLIENT_STEERING');
+
+
+-- +goose Down
+-- SQL section 'Down' is executed when this migration is rolled back

-- 
To stop receiving notification emails like this one, please contact
els...@apache.org.

Reply via email to