mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
dialect/entsql: add support for table checks in schema/migration
This commit is contained in:
committed by
Ariel Mashraki
parent
b8f4614bfd
commit
42a2c67cc4
File diff suppressed because one or more lines are too long
@@ -151,11 +151,21 @@ func init() {
|
||||
{{- with $ant.Options }}
|
||||
Options: "{{ . }}",
|
||||
{{- end }}
|
||||
{{- with $ant.Check }}
|
||||
Check: "{{ . }}",
|
||||
{{- end }}
|
||||
}
|
||||
{{- with $ant.Incremental }}
|
||||
{{ $table }}.Annotation.Incremental = new(bool)
|
||||
*{{ $table }}.Annotation.Incremental = {{ with indirect . }}true{{ else }}false{{ end }}
|
||||
{{- end }}
|
||||
{{- with $keys := keys $ant.Checks }}
|
||||
{{ $table }}.Annotation.Checks = map[string]string{
|
||||
{{- range $k := $keys }}
|
||||
"{{ $k }}": "{{ index $ant.Checks $k }}",
|
||||
{{- end }}
|
||||
}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user