|
Lines 188-195
sub _buildColumnValues {
Link Here
|
| 188 |
my @columns = $self->schema->source($source)->columns; |
188 |
my @columns = $self->schema->source($source)->columns; |
| 189 |
my %unique_constraints = $self->schema->source($source)->unique_constraints(); |
189 |
my %unique_constraints = $self->schema->source($source)->unique_constraints(); |
| 190 |
|
190 |
|
| 191 |
my $build_value = 3; |
191 |
my $build_value = 5; |
| 192 |
# we try max three times if there are unique constraints |
192 |
# we try max $build_value times if there are unique constraints |
| 193 |
BUILD_VALUE: while ( $build_value ) { |
193 |
BUILD_VALUE: while ( $build_value ) { |
| 194 |
# generate random values for all columns |
194 |
# generate random values for all columns |
| 195 |
for my $col_name( @columns ) { |
195 |
for my $col_name( @columns ) { |
|
Lines 442-448
sub _gen_text {
Link Here
|
| 442 |
$regex = '[A-Za-z]'; |
442 |
$regex = '[A-Za-z]'; |
| 443 |
} |
443 |
} |
| 444 |
my $random = String::Random->new( max => $size ); |
444 |
my $random = String::Random->new( max => $size ); |
| 445 |
return $random->randregex($regex); |
445 |
my $text = $random->randregex($regex); |
|
|
446 |
|
| 447 |
if ( $size ) { |
| 448 |
while ( $size and length($text) == 1 and $size > 1 ) { |
| 449 |
$text = $random->randregex($regex); |
| 450 |
} |
| 451 |
} |
| 452 |
return $text; |
| 446 |
} |
453 |
} |
| 447 |
|
454 |
|
| 448 |
sub _gen_set_enum { |
455 |
sub _gen_set_enum { |
| 449 |
- |
|
|