diff --git a/docs/built_in_transformers/standard_transformers/random_person.md b/docs/built_in_transformers/standard_transformers/random_person.md index b945ea0e..69099326 100644 --- a/docs/built_in_transformers/standard_transformers/random_person.md +++ b/docs/built_in_transformers/standard_transformers/random_person.md @@ -95,9 +95,6 @@ INSERT INTO personal_data (name, surname, sex) VALUES - name: "surname" template: "{{ .LastName }}" engine: "hash" - dynamic_params: - gender: - column: sex ``` ## Example: Populate random first name and last name for table user_profiles in dynamic mode @@ -112,7 +109,6 @@ gender transformers: - name: "RandomPerson" params: - gender: "Any" columns: - name: "name" template: "{{ .FirstName }}" diff --git a/internal/generators/transformers/random_person.go b/internal/generators/transformers/random_person.go index c322e3bf..ffa1fd18 100644 --- a/internal/generators/transformers/random_person.go +++ b/internal/generators/transformers/random_person.go @@ -3,6 +3,7 @@ package transformers import ( "encoding/binary" "fmt" + "slices" "github.com/greenmaskio/greenmask/internal/generators" ) @@ -147,6 +148,8 @@ func NewPersonalDatabase(data Database) *PersonDatabase { attributes = append(attributes, attrName) } + slices.Sort(attributes) + return &PersonDatabase{ Db: data, Attributes: attributes,