Skip to content

Commit

Permalink
fix: use toDateTime for ttl field
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed Jan 3, 2024
1 parent b3d0860 commit 796b0c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/chstorage/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ func (t Tables) generateQuery(opts generateOptions) string {
s.WriteString(opts.DDL)
if t.TTL > 0 && opts.TTLField != "" {
s.WriteString("\n")
s.WriteString("TTL ")
s.WriteString("TTL toDateTime(")
s.WriteString(opts.TTLField)
s.WriteString(" + INTERVAL ")
s.WriteString(") + INTERVAL ")
s.WriteString(fmt.Sprintf("%d", t.TTL/time.Second))
s.WriteString(" SECOND")
}
Expand Down

0 comments on commit 796b0c8

Please sign in to comment.