mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
dialect/sql/schema: add support for pg arrays in migration
This commit is contained in:
committed by
Ariel Mashraki
parent
eff6552989
commit
fd1f2df150
@@ -148,7 +148,7 @@ func UUID(name string, typ driver.Valuer) *uuidBuilder {
|
||||
// dialect.Postgres: "varchar",
|
||||
// })
|
||||
//
|
||||
func Other(name string, typ ValueScanner) *otherBuilder {
|
||||
func Other(name string, typ driver.Valuer) *otherBuilder {
|
||||
ob := &otherBuilder{&Descriptor{
|
||||
Name: name,
|
||||
Info: &TypeInfo{Type: TypeOther},
|
||||
|
||||
@@ -561,6 +561,12 @@ func TestField_Other(t *testing.T) {
|
||||
Descriptor()
|
||||
assert.NoError(t, fd.Err)
|
||||
|
||||
fd = field.Other("other", custom{}).
|
||||
SchemaType(map[string]string{dialect.Postgres: "varchar"}).
|
||||
Default(func() custom { return custom{} }).
|
||||
Descriptor()
|
||||
assert.NoError(t, fd.Err)
|
||||
|
||||
fd = field.Other("other", &custom{}).
|
||||
SchemaType(map[string]string{dialect.Postgres: "varchar"}).
|
||||
Default(func() custom { return custom{} }).
|
||||
|
||||
Reference in New Issue
Block a user