X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/624c53dc0cb5056d2c259aec6f815e69b8313ae0..f2af9def6777d0192a83c8a86f1332569c742051:/scripts/rose_auto_create_model.pl diff --git a/scripts/rose_auto_create_model.pl b/scripts/rose_auto_create_model.pl index f222cfa97..ba19a0c05 100755 --- a/scripts/rose_auto_create_model.pl +++ b/scripts/rose_auto_create_model.pl @@ -42,10 +42,6 @@ sub setup { my $login = shift @ARGV; - $::userspath = "users"; - $::templates = "templates"; - $::sendmail = "| /usr/sbin/sendmail -t"; - $::lxdebug = LXDebug->new(); require "config/lx-erp.conf"; @@ -71,17 +67,24 @@ sub setup { sub process_table { my @spec = split(/=/, shift, 2); my $table = $spec[0]; + my $schema = ''; + ($schema, $table) = split(m/\./, $table) if $table =~ m/\./; my $package = ucfirst($spec[1] || $spec[0]); $package =~ s/_+(.)/uc($1)/ge; my $meta_file = "${meta_path}/${package}.pm"; my $file = "SL/DB/${package}.pm"; + $schema = <meta->schema('$schema'); +CODE + my $definition = eval <meta->table('$table'); +$schema __PACKAGE__->meta->auto_initialize; __PACKAGE__->meta->perl_class_definition(indent => 2); # , braces => 'bsd'