File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -123,17 +123,17 @@ func (click *SClickhouseBackend) GetCreateSQLs(ts sqlchemy.ITableSpec) []string
123123 var ttlCol IClickhouseColumnSpec
124124 for _ , c := range ts .Columns () {
125125 cols = append (cols , c .DefinitionString ())
126+ if c .IsPrimary () {
127+ primaries = append (primaries , fmt .Sprintf ("`%s`" , c .Name ()))
128+ }
126129 if cc , ok := c .(IClickhouseColumnSpec ); ok {
130+ if cc .IsOrderBy () {
131+ orderbys = append (orderbys , fmt .Sprintf ("`%s`" , c .Name ()))
132+ }
127133 partition := cc .PartitionBy ()
128134 if len (partition ) > 0 && ! utils .IsInStringArray (partition , partitions ) {
129135 partitions = append (partitions , partition )
130136 }
131- if c .IsPrimary () && len (partition ) == 0 {
132- primaries = append (primaries , fmt .Sprintf ("`%s`" , c .Name ()))
133- }
134- if cc .IsOrderBy () && len (partition ) == 0 {
135- orderbys = append (orderbys , fmt .Sprintf ("`%s`" , c .Name ()))
136- }
137137 ttlC , ttlU := cc .GetTTL ()
138138 if ttlC > 0 && len (ttlU ) > 0 {
139139 ttlCol = cc
You can’t perform that action at this time.
0 commit comments