dialect/sql/schema: add support for pg arrays in migration

This commit is contained in:
Ariel Mashraki
2021-04-13 22:15:40 +03:00
committed by Ariel Mashraki
parent eff6552989
commit fd1f2df150
24 changed files with 585 additions and 23 deletions

View File

@@ -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},

View File

@@ -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{} }).