mirror of
https://github.com/ent/ent.git
synced 2026-05-03 08:00:58 +03:00
dialect/sql/schema: add optional schema-type to column spec (#461)
This commit is contained in:
@@ -137,19 +137,20 @@ func (t *Table) fk(symbol string) (*ForeignKey, bool) {
|
||||
|
||||
// Column schema definition for SQL dialects.
|
||||
type Column struct {
|
||||
Name string // column name.
|
||||
Type field.Type // column type.
|
||||
typ string // row column type (used for Rows.Scan).
|
||||
Attr string // extra attributes.
|
||||
Size int64 // max size parameter for string, blob, etc.
|
||||
Key string // key definition (PRI, UNI or MUL).
|
||||
Unique bool // column with unique constraint.
|
||||
Increment bool // auto increment attribute.
|
||||
Nullable bool // null or not null attribute.
|
||||
Default interface{} // default value.
|
||||
Enums []string // enum values.
|
||||
indexes Indexes // linked indexes.
|
||||
foreign *ForeignKey // linked foreign-key.
|
||||
Name string // column name.
|
||||
Type field.Type // column type.
|
||||
SchemaType map[string]string // optional schema type per dialect.
|
||||
Attr string // extra attributes.
|
||||
Size int64 // max size parameter for string, blob, etc.
|
||||
Key string // key definition (PRI, UNI or MUL).
|
||||
Unique bool // column with unique constraint.
|
||||
Increment bool // auto increment attribute.
|
||||
Nullable bool // null or not null attribute.
|
||||
Default interface{} // default value.
|
||||
Enums []string // enum values.
|
||||
typ string // row column type (used for Rows.Scan).
|
||||
indexes Indexes // linked indexes.
|
||||
foreign *ForeignKey // linked foreign-key.
|
||||
}
|
||||
|
||||
// UniqueKey returns boolean indicates if this column is a unique key.
|
||||
|
||||
Reference in New Issue
Block a user