Rose-Models für Mandantentabellen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 4 Jun 2013 13:55:03 +0000 (15:55 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 13 Jun 2013 14:24:18 +0000 (16:24 +0200)
SL/DB/AuthClient.pm [new file with mode: 0644]
SL/DB/AuthClientGroup.pm [new file with mode: 0644]
SL/DB/AuthClientUser.pm [new file with mode: 0644]
SL/DB/AuthGroup.pm
SL/DB/AuthUser.pm
SL/DB/Helper/ALL.pm
SL/DB/Helper/Mappings.pm
SL/DB/MetaSetup/AuthClient.pm [new file with mode: 0644]
SL/DB/MetaSetup/AuthClientGroup.pm [new file with mode: 0644]
SL/DB/MetaSetup/AuthClientUser.pm [new file with mode: 0644]

diff --git a/SL/DB/AuthClient.pm b/SL/DB/AuthClient.pm
new file mode 100644 (file)
index 0000000..5291da2
--- /dev/null
@@ -0,0 +1,32 @@
+# This file has been auto-generated only because it didn't exist.
+# Feel free to modify it at will; it will not be overwritten automatically.
+
+package SL::DB::AuthClient;
+
+use strict;
+
+use SL::DB::MetaSetup::AuthClient;
+
+# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
+__PACKAGE__->meta->schema('auth');
+
+__PACKAGE__->meta->make_manager_class;
+
+__PACKAGE__->meta->add_relationship(
+  users => {
+    type      => 'many to many',
+    map_class => 'SL::DB::AuthUserGroup',
+    map_from  => 'client',
+    map_to    => 'user',
+  },
+  groups => {
+    type      => 'many to many',
+    map_class => 'SL::DB::AuthUserGroup',
+    map_from  => 'client',
+    map_to    => 'group',
+  },
+);
+
+__PACKAGE__->meta->initialize;
+
+1;
diff --git a/SL/DB/AuthClientGroup.pm b/SL/DB/AuthClientGroup.pm
new file mode 100644 (file)
index 0000000..758841b
--- /dev/null
@@ -0,0 +1,15 @@
+# This file has been auto-generated only because it didn't exist.
+# Feel free to modify it at will; it will not be overwritten automatically.
+
+package SL::DB::AuthClientGroup;
+
+use strict;
+
+use SL::DB::MetaSetup::AuthClientGroup;
+
+# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
+__PACKAGE__->meta->schema('auth');
+
+__PACKAGE__->meta->make_manager_class;
+
+1;
diff --git a/SL/DB/AuthClientUser.pm b/SL/DB/AuthClientUser.pm
new file mode 100644 (file)
index 0000000..b2063dc
--- /dev/null
@@ -0,0 +1,15 @@
+# This file has been auto-generated only because it didn't exist.
+# Feel free to modify it at will; it will not be overwritten automatically.
+
+package SL::DB::AuthClientUser;
+
+use strict;
+
+use SL::DB::MetaSetup::AuthClientUser;
+
+# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
+__PACKAGE__->meta->schema('auth');
+
+__PACKAGE__->meta->make_manager_class;
+
+1;
index fe755c7..3d30177 100644 (file)
@@ -25,6 +25,12 @@ __PACKAGE__->meta->add_relationship(
     class      => 'SL::DB::AuthGroupRight',
     column_map => { id => 'group_id' },
   },
+  clients => {
+    type      => 'many to many',
+    map_class => 'SL::DB::AuthClient',
+    map_from  => 'group',
+    map_to    => 'client',
+  },
 );
 
 __PACKAGE__->meta->initialize;
index 2a15449..c1b46b4 100644 (file)
@@ -27,6 +27,12 @@ __PACKAGE__->meta->add_relationship(
     class      => 'SL::DB::AuthUserConfig',
     column_map => { id => 'user_id' },
   },
+  clients => {
+    type      => 'many to many',
+    map_class => 'SL::DB::AuthClient',
+    map_from  => 'user',
+    map_to    => 'client',
+  },
 );
 
 __PACKAGE__->meta->initialize;
index f951bf9..9962406 100644 (file)
@@ -5,6 +5,9 @@ use strict;
 use SL::DB::AccTransaction;
 use SL::DB::Assembly;
 use SL::DB::AuditTrail;
+use SL::DB::AuthClient;
+use SL::DB::AuthClientUser;
+use SL::DB::AuthClientGroup;
 use SL::DB::AuthGroup;
 use SL::DB::AuthGroupRight;
 use SL::DB::AuthUser;
index f0b8be9..81f4512 100644 (file)
@@ -37,11 +37,14 @@ my @lxoffice_blacklist = (@lxoffice_blacklist_permanent, @lxoffice_blacklist_tem
 my %lxoffice_package_names = (
   acc_trans                      => 'acc_transaction',
   audittrail                     => 'audit_trail',
-  auth_group                     => 'auth_groups',
-  auth_group_right               => 'auth_group_rights',
-  auth_user                      => 'auth_users',
-  auth_user_config               => 'auth_user_configs',
-  auth_user_group                => 'auth_user_groups',
+  'auth.clients'                 => 'auth_client',
+  'auth.clients_users'           => 'auth_client_user',
+  'auth.clients_groups'          => 'auth_client_group',
+  'auth.group'                   => 'auth_groups',
+  'auth.group_right'             => 'auth_group_rights',
+  'auth.user'                    => 'auth_users',
+  'auth.user_config'             => 'auth_user_configs',
+  'auth.user_group'              => 'auth_user_groups',
   ar                             => 'invoice',
   ap                             => 'purchase_invoice',
   background_jobs                => 'background_job',
diff --git a/SL/DB/MetaSetup/AuthClient.pm b/SL/DB/MetaSetup/AuthClient.pm
new file mode 100644 (file)
index 0000000..1b0a81a
--- /dev/null
@@ -0,0 +1,32 @@
+# This file has been auto-generated. Do not modify it; it will be overwritten
+# by rose_auto_create_model.pl automatically.
+package SL::DB::AuthClient;
+
+use strict;
+
+use base qw(SL::DB::Object);
+
+__PACKAGE__->meta->setup(
+  table   => 'clients',
+
+  columns => [
+    id         => { type => 'serial', not_null => 1 },
+    name       => { type => 'text', not_null => 1 },
+    dbhost     => { type => 'text', not_null => 1 },
+    dbport     => { type => 'integer', default => 5432, not_null => 1 },
+    dbname     => { type => 'text', not_null => 1 },
+    dbuser     => { type => 'text', not_null => 1 },
+    dbpasswd   => { type => 'text', not_null => 1 },
+    is_default => { type => 'boolean', default => 'false', not_null => 1 },
+  ],
+
+  primary_key_columns => [ 'id' ],
+
+  unique_keys => [
+    [ 'dbhost', 'dbport', 'dbname' ],
+    [ 'name' ],
+  ],
+);
+
+1;
+;
diff --git a/SL/DB/MetaSetup/AuthClientGroup.pm b/SL/DB/MetaSetup/AuthClientGroup.pm
new file mode 100644 (file)
index 0000000..e922639
--- /dev/null
@@ -0,0 +1,33 @@
+# This file has been auto-generated. Do not modify it; it will be overwritten
+# by rose_auto_create_model.pl automatically.
+package SL::DB::AuthClientGroup;
+
+use strict;
+
+use base qw(SL::DB::Object);
+
+__PACKAGE__->meta->setup(
+  table   => 'clients_groups',
+
+  columns => [
+    client_id => { type => 'integer', not_null => 1 },
+    group_id  => { type => 'integer', not_null => 1 },
+  ],
+
+  primary_key_columns => [ 'client_id', 'group_id' ],
+
+  foreign_keys => [
+    client => {
+      class       => 'SL::DB::AuthClient',
+      key_columns => { client_id => 'id' },
+    },
+
+    group => {
+      class       => 'SL::DB::AuthGroup',
+      key_columns => { group_id => 'id' },
+    },
+  ],
+);
+
+1;
+;
diff --git a/SL/DB/MetaSetup/AuthClientUser.pm b/SL/DB/MetaSetup/AuthClientUser.pm
new file mode 100644 (file)
index 0000000..b365772
--- /dev/null
@@ -0,0 +1,33 @@
+# This file has been auto-generated. Do not modify it; it will be overwritten
+# by rose_auto_create_model.pl automatically.
+package SL::DB::AuthClientUser;
+
+use strict;
+
+use base qw(SL::DB::Object);
+
+__PACKAGE__->meta->setup(
+  table   => 'clients_users',
+
+  columns => [
+    client_id => { type => 'integer', not_null => 1 },
+    user_id   => { type => 'integer', not_null => 1 },
+  ],
+
+  primary_key_columns => [ 'client_id', 'user_id' ],
+
+  foreign_keys => [
+    client => {
+      class       => 'SL::DB::AuthClient',
+      key_columns => { client_id => 'id' },
+    },
+
+    user => {
+      class       => 'SL::DB::AuthUser',
+      key_columns => { user_id => 'id' },
+    },
+  ],
+);
+
+1;
+;