From de97e9850beac9ccf4b34f67a7d26b82ebbfd87e Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Thu, 18 Dec 2008 13:01:54 +0000 Subject: [PATCH] =?utf8?q?=C3=84nderungen=20am=20Datenmodell?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- lib/FrBr/Books/Db/Autoren.pm | 6 ++---- lib/FrBr/Books/Db/Buecher.pm | 6 ++---- lib/FrBr/Books/Db/UserAdd.pm | 26 ++++++++++++++++++++++++++ lib/FrBr/Books/Db/Users.pm | 1 - 4 files changed, 30 insertions(+), 9 deletions(-) create mode 100644 lib/FrBr/Books/Db/UserAdd.pm diff --git a/lib/FrBr/Books/Db/Autoren.pm b/lib/FrBr/Books/Db/Autoren.pm index fc17146..d4e1903 100644 --- a/lib/FrBr/Books/Db/Autoren.pm +++ b/lib/FrBr/Books/Db/Autoren.pm @@ -22,10 +22,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("id"); __PACKAGE__->add_unique_constraint( "name", [ "nachname", "vorname", "mittelname", "name_suffix" ] ); - -# Created by DBIx::Class::Schema::Loader v0.04004 @ 2008-03-17 17:53:52 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QwPjYKNwUnR5b418xxulDg - +__PACKAGE__->has_many( 'autor_buch' => 'FrBr::Books::Db::Autor2Buch', { 'foreign.autor_id' => 'self.id' } ); +__PACKAGE__->many_to_many( 'buecher' => 'autor_buch', 'buch' ); # You can replace this text with custom content, and it will be preserved on regeneration 1; diff --git a/lib/FrBr/Books/Db/Buecher.pm b/lib/FrBr/Books/Db/Buecher.pm index a7979de..46e4c7d 100644 --- a/lib/FrBr/Books/Db/Buecher.pm +++ b/lib/FrBr/Books/Db/Buecher.pm @@ -34,11 +34,9 @@ __PACKAGE__->might_have( 'verlag' => 'FrBr::Books::Db::Verlage', { 'f __PACKAGE__->might_have( 'ort' => 'FrBr::Books::Db::Orte', { 'foreign.id' => 'self.orts_id' } ); __PACKAGE__->might_have( 'bindungsart' => 'FrBr::Books::Db::Bindungsarten', { 'foreign.id' => 'self.bindungsart_id' } ); -# Created by DBIx::Class::Schema::Loader v0.04004 @ 2008-03-17 17:53:52 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GjY80NXBYER1XlWgPukp+A +__PACKAGE__->has_many( 'autor_buch' => 'FrBr::Books::Db::Autor2Buch', { 'foreign.buch_id' => 'self.id' } ); +__PACKAGE__->many_to_many( 'autoren' => 'autor_buch', 'autor' ); - -# You can replace this text with custom content, and it will be preserved on regeneration 1; __END__ diff --git a/lib/FrBr/Books/Db/UserAdd.pm b/lib/FrBr/Books/Db/UserAdd.pm new file mode 100644 index 0000000..83aee31 --- /dev/null +++ b/lib/FrBr/Books/Db/UserAdd.pm @@ -0,0 +1,26 @@ +package FrBr::Books::Db::UserAdd; + +# $Id$ +# $URL$ + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("Core"); +__PACKAGE__->table("user_add"); +__PACKAGE__->add_columns( + "user_id" => { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 }, + "comments" => { data_type => "TEXT", default_value => undef, is_nullable => 0, size => 65535, }, +); +__PACKAGE__->set_primary_key("user_id"); + +__PACKAGE__->might_have( 'user' => 'FrBr::Books::Db::Users', { 'foreign.user_id' => 'self.user_id' } ); + +# You can replace this text with custom content, and it will be preserved on regeneration +1; + +__END__ + +# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab : diff --git a/lib/FrBr/Books/Db/Users.pm b/lib/FrBr/Books/Db/Users.pm index e4beabc..9359ee8 100644 --- a/lib/FrBr/Books/Db/Users.pm +++ b/lib/FrBr/Books/Db/Users.pm @@ -22,7 +22,6 @@ __PACKAGE__->add_columns( "deleted" => { data_type => "ENUM", default_value => "n", is_nullable => 0, size => 1 }, "enabled" => { data_type => "ENUM", default_value => "y", is_nullable => 0, size => 1 }, "admin_status" => { data_type => "ENUM", default_value => "n", is_nullable => 0, size => 1 }, - "comments" => { data_type => "TEXT", default_value => undef, is_nullable => 0, size => 65535, }, ); __PACKAGE__->set_primary_key("user_id"); __PACKAGE__->add_unique_constraint("login", ["login"]); -- 2.39.5