You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2017/03/09 19:09:25 UTC
[17/44] incubator-trafficcontrol git commit: Formatting, cleanup
Formatting, cleanup
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/827da100
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/827da100
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/827da100
Branch: refs/heads/master
Commit: 827da1003274ae798c083a7588e54dafdf08789f
Parents: 5110157
Author: Jan van Doorn <ja...@cable.comcast.com>
Authored: Wed Feb 8 07:42:00 2017 -0700
Committer: Jan van Doorn <jv...@apache.org>
Committed: Fri Feb 17 17:49:10 2017 +0000
----------------------------------------------------------------------
.../20170205101432_cdn_table_domain_name.go | 23 +++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/827da100/traffic_ops/app/db/migrations/20170205101432_cdn_table_domain_name.go
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/migrations/20170205101432_cdn_table_domain_name.go b/traffic_ops/app/db/migrations/20170205101432_cdn_table_domain_name.go
index af24643..72209ff 100644
--- a/traffic_ops/app/db/migrations/20170205101432_cdn_table_domain_name.go
+++ b/traffic_ops/app/db/migrations/20170205101432_cdn_table_domain_name.go
@@ -129,7 +129,16 @@ func Up_20170205101432(txn *sql.Tx) {
pDesc := "Deliveryservice profile for " + xml_id
pType := "DS_PROFILE"
mhrString := mid_header_rewrite.String
- pmap[pName] = Profile{Id: -1, Name: pName, Desc: pDesc, Type: pType, Cdn: cdn_id, MidHeaderRewrite: mhrString, MultiSiteOriginAlg: multi_site_origin_algorithm.Int64, XMLId: xml_id}
+ pmap[pName] = Profile{
+ Id: -1,
+ Name: pName,
+ Desc: pDesc,
+ Type: pType,
+ Cdn: cdn_id,
+ MidHeaderRewrite: mhrString,
+ MultiSiteOriginAlg: multi_site_origin_algorithm.Int64,
+ XMLId: xml_id,
+ }
}
err = rows.Err()
checkErr(err, txn)
@@ -155,8 +164,10 @@ func Up_20170205101432(txn *sql.Tx) {
newId, ok = existingParam[string(match[1])+string(match[2])]
fmt.Printf("%s -> %v %v\n", string(match[1])+string(match[2]), newId, ok)
if !ok {
- fmt.Println("INSERT INTO PARAMETER (name, config_file, value) VALUES ($1, $2, $3) RETURNING id", "mso."+string(match[1]), "parent.config", string(match[2]))
- newRow := txn.QueryRow("INSERT INTO PARAMETER (name, config_file, value) VALUES ($1, $2, $3) RETURNING id", "mso."+string(match[1]), "parent.config", string(match[2]))
+ fmt.Println("INSERT INTO PARAMETER (name, config_file, value) VALUES ($1, $2, $3) RETURNING id", "mso."+
+ string(match[1]), "parent.config", string(match[2]))
+ newRow := txn.QueryRow("INSERT INTO PARAMETER (name, config_file, value) VALUES ($1, $2, $3) RETURNING id", "mso."+
+ string(match[1]), "parent.config", string(match[2]))
err := newRow.Scan(&newId)
checkErr(err, txn)
existingParam[string(match[1])+string(match[2])] = newId
@@ -182,8 +193,10 @@ func Up_20170205101432(txn *sql.Tx) {
var ok bool
newId, ok = existingParam["mso.algorithm"+"parent.config"+string(prof.MultiSiteOriginAlg)]
if !ok {
- fmt.Println("INSERT INTO PARAMETER (name, config_file, value) VALUES ($1, $2, $3) RETURNING id", "mso.algorithm", "parent.config", prof.MultiSiteOriginAlg)
- newRow = txn.QueryRow("INSERT INTO PARAMETER (name, config_file, value) VALUES ($1, $2, $3) RETURNING id", "mso.algorithm", "parent.config", prof.MultiSiteOriginAlg)
+ fmt.Println("INSERT INTO PARAMETER (name, config_file, value) VALUES ($1, $2, $3) RETURNING id",
+ "mso.algorithm", "parent.config", prof.MultiSiteOriginAlg)
+ newRow = txn.QueryRow("INSERT INTO PARAMETER (name, config_file, value) VALUES ($1, $2, $3) RETURNING id",
+ "mso.algorithm", "parent.config", prof.MultiSiteOriginAlg)
err = newRow.Scan(&newId)
checkErr(err, txn)
existingParam["mso.algorithm"+"parent.config"+string(prof.MultiSiteOriginAlg)] = newId