Revision 208064c9
Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt
scripts/rose_auto_create_model.pl | ||
---|---|---|
241 | 241 |
GetOptions( |
242 | 242 |
'client=s' => \ my $client, |
243 | 243 |
all => \ my $all, |
244 |
'db=s' => \ my $db, |
|
244 | 245 |
'no-commit|dry-run' => \ my $nocommit, |
245 | 246 |
help => sub { pod2usage(verbose => 99, sections => 'NAME|SYNOPSIS|OPTIONS') }, |
246 | 247 |
quiet => \ my $quiet, |
... | ... | |
249 | 250 |
|
250 | 251 |
$options->{client} = $client; |
251 | 252 |
$options->{all} = $all; |
253 |
$options->{db} = $db; |
|
252 | 254 |
$options->{nocommit} = $nocommit; |
253 | 255 |
$options->{quiet} = $quiet; |
254 | 256 |
$options->{color} = -t STDOUT ? 1 : 0; |
... | ... | |
288 | 290 |
sub make_tables { |
289 | 291 |
my %tables_by_domain; |
290 | 292 |
if ($config{all}) { |
291 |
foreach my $domain (sort keys %package_names) { |
|
293 |
my @domains = $config{db} ? (uc $config{db}) : sort keys %package_names; |
|
294 |
|
|
295 |
foreach my $domain (@domains) { |
|
292 | 296 |
my $db = SL::DB::create(undef, $domain); |
293 | 297 |
$tables_by_domain{$domain} = [ grep { my $table = $_; none { $_ eq $table } @{ $blacklist{$domain} } } $db->list_tables ]; |
294 | 298 |
$db->disconnect; |
... | ... | |
363 | 367 |
scripts/rose_auto_create_model.pl --client name-or-id [--all|-a] |
364 | 368 |
|
365 | 369 |
# updates all models |
366 |
scripts/rose_auto_create_model.pl --client name-or-id --all |
|
370 |
scripts/rose_auto_create_model.pl --client name-or-id --all [--db db]
|
|
367 | 371 |
|
368 | 372 |
# updates only customer table, login taken from config |
369 | 373 |
scripts/rose_auto_create_model.pl customer |
... | ... | |
443 | 447 |
Process all tables from the database. Only those that are blacklistes in |
444 | 448 |
L<SL::DB::Helper::Mappings> are excluded. |
445 | 449 |
|
450 |
=item C<--db db> |
|
451 |
|
|
452 |
In combination with C<--all> causes all tables in the specific |
|
453 |
database to be processed, not in all databases. |
|
454 |
|
|
446 | 455 |
=item C<--no-commit, -n> |
447 | 456 |
|
448 | 457 |
=item C<--dry-run> |
Auch abrufbar als: Unified diff
Rose-Model-Generator: --db für nur eine Datenbank bei --all
Siehe auch Commit »Rose-Model-Generator: prinzipielle Unterstützung
verschiedener Datenbanken«.