func (m *GormIdentityRepository) Create(ctx context.Context, model *Identity) error {
	defer goa.MeasureSince([]string{"goa", "db", "identity", "create"}, time.Now())

	if model.ID == uuid.Nil {
		model.ID = uuid.NewV4()
	}
	err := m.db.Create(model).Error
	if err != nil {
		log.Error(ctx, map[string]interface{}{
			"identity_id": model.ID,
			"err":         err,
		}, "unable to create the identity")
		return errors.WithStack(err)
	}

	log.Debug(ctx, map[string]interface{}{
		"identity_id": model.ID,
	}, "Identity created!")

	return nil
}
// Create creates a new record.
Create creates a new record.
// Create creates a new record .
func (m *GormIdentityRepository) Create(ctx context.Context, model *Identity) error {
	defer goa.MeasureSince([]string{"goa", "db", "identity", "create"}, time.Now())
	if model.ID == uuid.Nil {
		model.ID = uuid.NewV4()
	}
	err := m.db.Create(model).Error
	if err != nil {
		log.Error(ctx, map[string]interface{}{
			"identity_id": model.ID,
			"err":         err,
		}, "unable to create the identity")
		return errors.WithStack(err)
	}
	log.Debug(ctx, map[string]interface{}{
		"identity_id": model.ID,
	}, "Identity created!")
	return nil
}
func ( m * GormIdentityRepository ) Create ( ctx context . Context , model * Identity ) error { defer goa . MeasureSince ( [ ] string { " " , " " , " " , " " } , time . Now ( ) ) if model . ID == uuid . Nil { model . ID = uuid . NewV4 ( ) } err := m . db . Create ( model ) . Error if err != nil { log . Error ( ctx , map [ string ] interface { } { " " : model . ID , " " : err , } , " " ) return errors . WithStack ( err ) } log . Debug ( ctx , map [ string ] interface { } { " " : model . ID , } , " " ) return nil }
Create creates a new record.
Create creates a new record .