From 27b6a7202b340eb2a1cf447a0a51abc85a89dc79 Mon Sep 17 00:00:00 2001 From: dsdave Date: Tue, 20 Dec 2016 00:49:10 -0800 Subject: [PATCH] Fixed #36 Root cause: commit to gocql repository. Revision #dff0cafdc4ab807c5e90e09f351b87ae4eb852cc --- generator/template.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/generator/template.go b/generator/template.go index a98ee5e..ad40baa 100644 --- a/generator/template.go +++ b/generator/template.go @@ -47,19 +47,19 @@ func isCounterColumn(c gocql.ColumnMetadata) bool { } func supportsClustering(c gocql.ColumnMetadata) bool { - return c.Kind == gocql.CLUSTERING_KEY + return c.Kind == gocql.ColumnClusteringKey } func supportsPartitioning(c gocql.ColumnMetadata) bool { - return c.Kind == gocql.PARTITION_KEY + return c.Kind == gocql.ColumnPartitionKey } func isLastComponent(c gocql.ColumnMetadata, t *gocql.TableMetadata) bool { switch c.Kind { - case gocql.PARTITION_KEY: + case gocql.ColumnPartitionKey: lastPartitionKeyColumn := t.PartitionKey[len(t.PartitionKey)-1] return c.Name == lastPartitionKeyColumn.Name - case gocql.CLUSTERING_KEY: + case gocql.ColumnClusteringKey: lastClusteringColumn := t.ClusteringColumns[len(t.ClusteringColumns)-1] return c.Name == lastClusteringColumn.Name default: @@ -82,13 +82,13 @@ func columnType(c gocql.ColumnMetadata, table *gocql.TableMetadata) string { baseType := columnTypes[t.Type()] // TODO The Kind field should be an enum, not a string - if c.Kind == gocql.CLUSTERING_KEY { + if c.Kind == gocql.ColumnClusteringKey { replacement := ".Clustered" if isLastComponent(c, table) { replacement = ".LastClustered" } baseType = strings.Replace(baseType, ".", replacement, 1) - } else if c.Kind == gocql.PARTITION_KEY { + } else if c.Kind == gocql.ColumnPartitionKey { replacement := ".Partitioned" if isLastComponent(c, table) { replacement = ".LastPartitioned"