Allow customize AutoIncrement for primary field
This commit is contained in:
		
							parent
							
								
									30188e7aa4
								
							
						
					
					
						commit
						e1084e78d0
					
				| @ -187,8 +187,11 @@ func Parse(dest interface{}, cacheStore *sync.Map, namer Namer) (*Schema, error) | ||||
| 			if !field.HasDefaultValue || field.DefaultValueInterface != nil { | ||||
| 				schema.FieldsWithDefaultDBValue = append(schema.FieldsWithDefaultDBValue, field) | ||||
| 			} | ||||
| 			field.HasDefaultValue = true | ||||
| 			field.AutoIncrement = true | ||||
| 
 | ||||
| 			if _, ok := field.TagSettings["AUTOINCREMENT"]; !ok { | ||||
| 				field.HasDefaultValue = true | ||||
| 				field.AutoIncrement = true | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Jinzhu
						Jinzhu