@@ -71,7 +71,7 @@ func (c *ContentTypesRollup) GetDestTable(ctID string, spec Spec) (*schema.Table
71
71
propName += "Id"
72
72
}
73
73
if propName == prop {
74
- field = & fieldData
74
+ field = fieldData
75
75
break
76
76
}
77
77
}
@@ -111,10 +111,10 @@ func (c *ContentTypesRollup) GetDestTable(ctID string, spec Spec) (*schema.Table
111
111
}
112
112
113
113
type contentTypeInfo struct {
114
- ID string `json:"StringId"`
115
- Name string `json:"Name"`
116
- Description string `json:"Description"`
117
- Fields []api.FieldInfo `json:"Fields"`
114
+ ID string `json:"StringId"`
115
+ Name string `json:"Name"`
116
+ Description string `json:"Description"`
117
+ Fields []* api.FieldInfo `json:"Fields"`
118
118
}
119
119
120
120
func (c * ContentTypesRollup ) getContentTypeInfo (ctID string ) (* contentTypeInfo , error ) {
@@ -141,49 +141,49 @@ func (c *ContentTypesRollup) getContentTypeInfo(ctID string) (*contentTypeInfo,
141
141
return info [0 ], nil
142
142
}
143
143
144
- func (с * ContentTypesRollup ) columnFromField (field * api.FieldInfo , tableName string ) schema.Column {
145
- logger := с .logger .With ().Str ("table" , tableName ).Logger ()
144
+ func (c * ContentTypesRollup ) columnFromField (field * api.FieldInfo , tableName string ) schema.Column {
145
+ logger := c .logger .With ().Str ("table" , tableName ).Logger ()
146
146
147
- c := schema.Column {
147
+ col := schema.Column {
148
148
Description : field .Description ,
149
149
}
150
150
151
151
switch field .TypeAsString {
152
152
case "Text" , "Note" , "ContentTypeId" :
153
- c .Type = schema .TypeString
153
+ col .Type = schema .TypeString
154
154
case "Integer" , "Counter" :
155
- c .Type = schema .TypeInt
155
+ col .Type = schema .TypeInt
156
156
case "Currency" :
157
- c .Type = schema .TypeFloat
157
+ col .Type = schema .TypeFloat
158
158
case "Number" :
159
- c .Type = schema .TypeFloat
159
+ col .Type = schema .TypeFloat
160
160
case "DateTime" :
161
- c .Type = schema .TypeTimestamp
161
+ col .Type = schema .TypeTimestamp
162
162
case "Boolean" , "Attachments" :
163
- c .Type = schema .TypeBool
163
+ col .Type = schema .TypeBool
164
164
case "Guid" :
165
- c .Type = schema .TypeUUID
165
+ col .Type = schema .TypeUUID
166
166
case "Lookup" , "User" :
167
- c .Type = schema .TypeInt
167
+ col .Type = schema .TypeInt
168
168
case "LookupMulti" , "UserMulti" :
169
- c .Type = schema .TypeIntArray
169
+ col .Type = schema .TypeIntArray
170
170
case "Choice" :
171
- c .Type = schema .TypeString
171
+ col .Type = schema .TypeString
172
172
case "MultiChoice" :
173
- c .Type = schema .TypeStringArray
173
+ col .Type = schema .TypeStringArray
174
174
case "Computed" :
175
- c .Type = schema .TypeString
175
+ col .Type = schema .TypeString
176
176
default :
177
177
logger .Warn ().Str ("type" , field .TypeAsString ).Int ("kind" , field .FieldTypeKind ).Str ("field_title" , field .Title ).Str ("field_id" , field .ID ).Msg ("unknown type, assuming JSON" )
178
- c .Type = schema .TypeString
178
+ col .Type = schema .TypeString
179
179
}
180
180
181
- c .Name = util .NormalizeEntityName (field .InternalName )
181
+ col .Name = util .NormalizeEntityName (field .InternalName )
182
182
183
- return c
183
+ return col
184
184
}
185
185
186
- func (c * ContentTypesRollup ) typeFromPropName (prop string ) schema.ValueType {
186
+ func (* ContentTypesRollup ) typeFromPropName (prop string ) schema.ValueType {
187
187
if strings .HasSuffix (prop , "/Id" ) && prop != "ParentList/Id" {
188
188
return schema .TypeInt
189
189
}
0 commit comments