Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 7c931a23

Von Moritz Bunkus vor etwa 12 Jahren hinzugefügt

  • ID 7c931a23dd4be179df2003599724734a23a9eade
  • Vorgänger 7ea32650
  • Nachfolger fcbb613d

SugarCRM-Unterstützt aus rose_auto_create_model.pl entfernt

Unterschiede anzeigen:

scripts/rose_auto_create_model.pl
162 162
  GetOptions(
163 163
    'login|user=s'      => \ my $login,
164 164
    all                 => \ my $all,
165
    sugar               => \ my $sugar,
166 165
    'no-commit|dry-run' => \ my $nocommit,
167 166
    help                => sub { pod2usage(verbose => 99, sections => 'NAME|SYNOPSIS|OPTIONS') },
168 167
    verbose             => \ my $verbose,
......
170 169
  );
171 170

  
172 171
  $options->{login}    = $login if $login;
173
  $options->{sugar}    = $sugar;
174 172
  $options->{all}      = $all;
175 173
  $options->{nocommit} = $nocommit;
176 174
  $options->{verbose}  = $verbose;
......
205 203

  
206 204
sub make_tables {
207 205
  my @tables;
208
  if ($config{all} || $config{sugar}) {
209
    my ($type, $prefix) = $config{sugar} ? ('SUGAR', 'sugar_') : ('LXOFFICE', '');
210
    my $db              = SL::DB::create(undef, $type);
211
    @tables             =
212
      map { $package_names{$type}->{$_} ? "$_=" . $package_names{$type}->{$_} : $prefix ? "$_=$prefix$_" : $_ }
213
      grep { my $table = $_; !any { $_ eq $table } @{ $blacklist{$type} } }
206
  if ($config{all}) {
207
    my $db  = SL::DB::create(undef, 'LXOFFICE');
208
    @tables =
209
      map { $package_names{LXOFFICE}->{$_} ? "$_=" . $package_names{LXOFFICE}->{$_} : $_ }
210
      grep { my $table = $_; !any { $_ eq $table } @{ $blacklist{LXOFFICE} } }
214 211
      $db->list_tables;
215 212
  } elsif (@ARGV) {
216 213
    @tables = @ARGV;
217 214
  } else {
218
    error("You specified neither --sugar nor --all nor any specific tables.");
215
    error("You specified neither --all nor any specific tables.");
219 216
    usage();
220 217
  }
221 218

  
......
254 251
=head1 SYNOPSIS
255 252

  
256 253
  scripts/rose_create_model.pl --login login table1[=package1] [table2[=package2] ...]
257
  scripts/rose_create_model.pl --login login [--all|-a] [--sugar|-s]
254
  scripts/rose_create_model.pl --login login [--all|-a]
258 255

  
259 256
  # updates all models
260 257
  scripts/rose_create_model.pl --login login --all
......
324 321
Process all tables from the database. Only those that are blacklistes in
325 322
L<SL::DB::Helper::Mappings> are excluded.
326 323

  
327
=item C<--sugar, -s>
328

  
329
Process tables in sugar schema instead of standard schema. Rarely useful unless
330
you debug schema awareness of the RDBO layer.
331

  
332 324
=item C<--no-commit, -n>
325

  
333 326
=item C<--dry-run>
334 327

  
335 328
Do not write back generated files. This will do everything as usual but not

Auch abrufbar als: Unified diff