File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -960,7 +960,7 @@ func getBulkReturningValues(db *gorm.DB, rowCount int) {
960960 }
961961
962962 // Get all table columns
963- allColumns := db .Statement .Schema . DBNames
963+ allColumns := getCreatableFields ( db .Statement .Schema )
964964
965965 // Find the actual starting index of OUT parameters
966966 actualStartIndex := - 1
Original file line number Diff line number Diff line change @@ -1004,18 +1004,22 @@ func TestCreateChildrenWithMixedPointers(t *testing.T) {
10041004
10051005}
10061006
1007+ // Fixes Issue #116
10071008func TestCreateReadOnlyJson (t * testing.T ) {
10081009 type record struct {
1009- ID string `gorm:"column:child_id;primaryKey;type:varchar(36)"`
1010- ReadOnlyField string `gorm:"->;-:migration;column:read_only_field;type:varchar(100)"`
1011- JsonTypeField datatypes.JSON `gorm:"column:json_type_field;type:json"`
1010+ ID string `gorm:"column:child_id;primaryKey;type:varchar(36)"`
1011+ ReadOnlyField string `gorm:"->;-:migration;column:read_only_field;type:varchar(100)"`
1012+ JsonTypeField datatypes.JSON `gorm:"column:json_type_field;type:json"`
1013+ JsonTypeField2 AttributeMap `gorm:"column:json_type_field2;type:json"`
10121014 }
10131015
10141016 json := datatypes .JSON (fmt .Sprintf (`{"key":"%s"}` , strings .Repeat ("x" , 4000 )))
1017+ attributeMapJSON := AttributeMap {"key" : strings .Repeat ("x" , 4000 )}
10151018 records := []record {
10161019 {
1017- ID : "1" ,
1018- JsonTypeField : json ,
1020+ ID : "1" ,
1021+ JsonTypeField : json ,
1022+ JsonTypeField2 : attributeMapJSON ,
10191023 },
10201024 {
10211025 ID : "2" ,
You can’t perform that action at this time.
0 commit comments