mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
dialect/entsql: add support for column default using annotation
Fixed #1033
This commit is contained in:
committed by
Ariel Mashraki
parent
3db3f5fd1a
commit
745afde770
@@ -35,6 +35,19 @@ type Annotation struct {
|
||||
//
|
||||
Collation string `json:"collation,omitempty"`
|
||||
|
||||
// Default specifies the default value of a column. Note that using this option
|
||||
// will override the default behavior of the code-generation. For example:
|
||||
//
|
||||
// entsql.Annotation{
|
||||
// Default: "CURRENT_TIMESTAMP",
|
||||
// }
|
||||
//
|
||||
// entsql.Annotation{
|
||||
// Default: "uuid_generate_v4()",
|
||||
// }
|
||||
//
|
||||
Default string `json:"default,omitempty"`
|
||||
|
||||
// Options defines the additional table options. For example:
|
||||
//
|
||||
// entsql.Annotation{
|
||||
|
||||
Reference in New Issue
Block a user