15 lines
407 B
Go
15 lines
407 B
Go
package tracking
|
|
|
|
const Sql_table = `
|
|
create table {{ .tablename }} (
|
|
trackid {{ .idType }} primary key,
|
|
{{- range .headFields -}}{{ . }} text,
|
|
{{ end -}}
|
|
timestamp timestamptz default current_timestamp,
|
|
data {{ .jsonType -}}
|
|
);
|
|
|
|
{{ range $i, $cols := .indexes }}
|
|
create index idx_{{ .i }} on {{ .tablename }} ({{ .cols }});
|
|
{{- end }}
|
|
create index idx_timestamp on {{ .tablename }} (timestamp);`
|