hello guys, I just rewritten the C4::Bookseller::AddBookseller and it now looks like: sub AddBookseller { _koha_insert_and_get_id( 'aqbooksellers', shift ); } _koha_insert_and_get_id is a function where i deal with DBI and all specific DBD tricks with reuse in mind. You can see the following code. do i try to push it in koha ? and where ? It sounds like Koha::SQL package. regards sub _koha_insert_and_get_id { # Todo: implement uses of config # like exclude, defaults, ... # $tablename is a string and contains the name of the table # $data is a reference to an hash that contains column names to set as keys # optionnal $config alter default behaviour my ( $tablename, $data, $config ) = @_; my $dbh = C4::Context->dbh; # @fields to insert are all %$data (unless overwritten by $$config{fields} ) my @fields = (defined $config and exists $config->{fields}) ? @{ $config->{fields} } : keys %$data ; # build the query my $query = 'INSERT INTO ' . $tablename .' (' . join(',',@fields) . ') VALUES (' . join(',', map {'?'} @fields) . ');' ; my $sth = $dbh->prepare($query); # deal with the server $sth->execute( @$data{@fields}); if ( $sth->err ) { warn $sth->errstr; return undef; } # return the last id C4::Context->config('db_scheme') eq 'mysql' and return $dbh->{mysql_insertid}; # todo use the last_insert_id dbh function # my $id = $dbh->last_insert_id( ? ); # before give up warn 'database unable to get last inserted id'; return undef; } -- Marc Chantreux http://www.biblibre.com Expert en Logiciels Libres pour l'info-doc
Marc -- Looks cool. We have been talking about consolidating all the repetitive table operations in similar ways. I have an experimental implementation as "C4::Table" that also tries to provide baseline SELECT, UPDATE and eventually DELETE. I think I'll have a chance to look at it more on Friday, after which maybe I can send some patches for review and further experimentation? It is a little more of an OO approach, and I'll be interested to see what you think of it. --Joe Atzberger On Wed, Oct 15, 2008 at 9:28 AM, Marc Chantreux <marc.chantreux@biblibre.com
wrote:
hello guys,
I just rewritten the C4::Bookseller::AddBookseller and it now looks like:
sub AddBookseller { _koha_insert_and_get_id( 'aqbooksellers', shift ); }
_koha_insert_and_get_id is a function where i deal with DBI and all specific DBD tricks with reuse in mind. You can see the following code.
do i try to push it in koha ? and where ? It sounds like Koha::SQL package.
regards
sub _koha_insert_and_get_id {
# Todo: implement uses of config # like exclude, defaults, ...
# $tablename is a string and contains the name of the table # $data is a reference to an hash that contains column names to set as keys # optionnal $config alter default behaviour
my ( $tablename, $data, $config ) = @_; my $dbh = C4::Context->dbh;
# @fields to insert are all %$data (unless overwritten by $$config{fields} ) my @fields = (defined $config and exists $config->{fields}) ? @{ $config->{fields} } : keys %$data ;
# build the query my $query = 'INSERT INTO ' . $tablename .' (' . join(',',@fields) . ') VALUES (' . join(',', map {'?'} @fields) . ');' ;
my $sth = $dbh->prepare($query);
# deal with the server
$sth->execute( @$data{@fields}); if ( $sth->err ) { warn $sth->errstr; return undef; }
# return the last id C4::Context->config('db_scheme') eq 'mysql' and return $dbh->{mysql_insertid};
# todo use the last_insert_id dbh function # my $id = $dbh->last_insert_id( ? ); # before give up
warn 'database unable to get last inserted id'; return undef;
}
-- Marc Chantreux http://www.biblibre.com Expert en Logiciels Libres pour l'info-doc <http://lists.koha.org/mailman/listinfo/koha-devel>
Joe Atzberger a écrit :
Marc --
Hi Joe, so, in fact, it's marc ++, right ;-) we (BibLibre) have decided to dedicate Marc half time on this kind of subjects, from nov, 1st, to dec, 31. Marc has a lot of ideas that, i'm sure will improve Koha performances & code. (PS : Unless a new contract falls from nowhere and needs to be done urgently) -- Paul POULAIN http://www.biblibre.com Expert en Logiciels Libres pour l'info-doc NOUVEAU TELEPHONE : 04 91 81 35 08
Joe Atzberger a écrit :
Marc --
I think you meant Marc++ ;)
Looks cool. We have been talking about consolidating all the repetitive table operations in similar ways. I have an experimental implementation as "C4::Table" that also tries to provide baseline SELECT, UPDATE and eventually DELETE. I think I'll have a chance to look at it more on Friday, after which maybe I can send some patches for review and further experimentation? It is a little more of an OO approach, and I'll be interested to see what you think of it. looking forward to see the code. Are you looking at sthg really near from DBIx::Class ?
On Wed, Oct 15, 2008 at 10:45:07AM -0400, Joe Atzberger wrote:
Marc --
yeah, i know ... that's almost a part of your autoreply, now :)
It is a little more of an OO approach, and I'll be interested to see what you think of it.
it would be a pleasure to me. I didn't use OO approach because koha don't use it but i think that adding some objects to koha code would be a very good idea. Encapsulate DBI stuff in objects is the mean of ORMs and CPAN have very good ones such as Jifty::DBI or DBIx::Class. What's your opinion about them? Don't you think that koha use one of these ? Regards -- Marc Chantreux http://www.biblibre.com Expert en Logiciels Libres pour l'info-doc
I highly favor adopting DBIx::Class or another db abstraction layer over writing our own lightweight abstraction layer. While it will seem lighter at first to create our own, we will want to add more functionality, multi-db support, etc. I think it is better to take advantage of the excellent work already out there for this. Andy (acmoore) here at LibLime has been investigating DBIx::Class as a side project; he will likely post some results soon. Regards, Ryan On Wed, Oct 15, 2008 at 11:32 AM, Marc Chantreux < marc.chantreux@biblibre.com> wrote:
On Wed, Oct 15, 2008 at 10:45:07AM -0400, Joe Atzberger wrote:
Marc --
yeah, i know ... that's almost a part of your autoreply, now :)
It is a little more of an OO approach, and I'll be interested to see what you think of it.
it would be a pleasure to me.
I didn't use OO approach because koha don't use it but i think that adding some objects to koha code would be a very good idea.
Encapsulate DBI stuff in objects is the mean of ORMs and CPAN have very good ones such as Jifty::DBI or DBIx::Class. What's your opinion about them? Don't you think that koha use one of these ?
Regards
-- Marc Chantreux http://www.biblibre.com Expert en Logiciels Libres pour l'info-doc _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha.org http://lists.koha.org/mailman/listinfo/koha-devel
-- Ryan Higgins LibLime * Open-Source Solutions for Libraries Featuring KohaZOOM ILS 888-564-2457 x704
On Wed, Oct 15, 2008 at 12:41 PM, Ryan Higgins <ryan.higgins@liblime.com> wrote:
I highly favor adopting DBIx::Class or another db abstraction layer over writing our own lightweight abstraction layer. While it will seem lighter at first to create our own, we will want to add more functionality, multi-db support, etc. I think it is better to take advantage of the excellent work already out there for this.
+1 Regards, Chris
Ryan mentioned recently that I'v been exploring using DBIx::Class to help us abstract away many of our database interactions. Although I don't believe I have a workable solution yet, I think I've been making progress. I'd like to share what I have so far to see if you guys have any opinions on how this might work, or even some help on solving some of the remaining questions and problems. There are a few patches in emails that follow this one that implement a partial solution. DBix::Class is one of the more popular object-relational mapping (ORM) tools for perl. It can help us by abstracting away our database interaction and letting us use a few objects to talk to the database instead. The following patches show one way that we could start using DBIx::Class, but are certainly not the only way. I hope that this can help us out, but I'm looking forward to hearing about other tools that we could use or other ways to use DBIx::Class. Some of the advantages of this proposal are: We would no longer have to write (as much) SQL. As perl programmers, we're pretty good at perl, but typically our SQL skills aren't as refined. This lets us outsource the SQL to the guys that write the DBIx::Class modules. These modules are well tested and dependable. This is a step towards supporting other databases. Since we can abstract away the SQL, we won't be writing MySQL specific SQL. I think this is a step towards supporting postgresql or Oracle or other databases. DBIx::Class can run on many popular databases. Some downsides: I think the worst problem here is that there is probably a large startup time being paid here. The Schema::Loader reads the whole database schema and makes a perl object out of it. That's probably more computing than we want to do with each page load. Since we're not running under mod_perl in most instances, this is probably a deal killer. I'm not sure if it's best to solve this by moving to mod_perl, letting the Schema::Loader use it's dump_to_directory method to make a cache of the database structure, explicitly define the database structure to DBIx::Class, or what. I do think this is the most important problem that needs to be solved before starting to use this code. There are reports that DBIx:Class may come with a performace penalty. We can research this more throoughly and see how bad it's expected to be. We can also write direct SQL in those places where performance seems to be a real problem. DBIx::Class is a new dependency, and it requires some modules itself. Finally, thanks to Marc Chantreux and others on the koha-devel list for encouraging me to make forward progress on this. I was hoping that I was not the only one looking for something like this. Andrew Moore (4): DBIx::Class - adjusting t/Makefile to find private library DBIx::Class - new C4::Schema object DBix::Class - moving C4::ClassSource over to using DBIx::Class DBIx::Class - Changes to C4::Members to start using DBIx::Class C4/Accounts.pm | 2 +- C4/ClassSource.pm | 66 ++++++++++++---------------- C4/Members.pm | 25 +++++------ C4/Schema.pm | 20 +++++++++ t/Makefile | 2 +- t/lib/KohaTest/ClassSource.pm | 34 +++++++++++++++ t/lib/KohaTest/ClassSource/ClassSource.pm | 56 ++++++++++++++++++++++++ 7 files changed, 151 insertions(+), 54 deletions(-) create mode 100644 C4/Schema.pm create mode 100644 t/lib/KohaTest/ClassSource.pm create mode 100644 t/lib/KohaTest/ClassSource/ClassSource.pm
This first patch contains a C4::Schema object, which is a subclass of a DBIx::Class class that reads the database and figures out the schema from there. It can eventually be our interface into the database, replacing the SQL that we write. There are other ways to write this. Alternative suggestions are encouraged. --- C4/Schema.pm | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) create mode 100644 C4/Schema.pm diff --git a/C4/Schema.pm b/C4/Schema.pm new file mode 100644 index 0000000..aa4f9a6 --- /dev/null +++ b/C4/Schema.pm @@ -0,0 +1,20 @@ +package C4::Schema; +use base qw/DBIx::Class::Schema::Loader/; + +__PACKAGE__->loader_options( + debug => 0, +); + +my $context = C4::Context->new(); + +my $db_driver = 'mysql'; +my $db_name = $context->config('database'); +my $db_host = $context->config('hostname'); +my $db_port = $context->config('port') || ''; +my $db_user = $context->config('user'); +my $db_passwd = $context->config('pass'); + +__PACKAGE__->connection( "DBI:$db_driver:dbname=$db_name;host=$db_host;port=$db_port", + $db_user, $db_passwd); + +1; -- 1.5.6
This is an example of replacing the SQL calls in the first half of the C4/ClassSource.pm file with calls to the DBIx::Class schema object. I used this module as an example because it's rather simple and you can see how the more simple SQL operations can get replaced by calls to the schema object. I've included some test files that pass both before and after the changes. I'm hopeful that they demonstrate that the functionality hasn't changed. I did have to adjust the way that C4::Accounts referenced C4::Circulation. I'm not sure why, but it was giving errors to explicitly request that MarkIssueReturned be exported when it was already always unonditionally exported. One thing to note: While this is a perfectly valid way to transition, I would recommend that we eventually take one further step. In this file there are two sets of functions that perform simple operations on two tables. They create, read, update, and delete records in those tables. I will recommend that we eventaully make a base class that provides those essential operations and then subclass it for each of our tables that act this way. Then, we can add in any functionality particular to those subclasses. I haven't addressed that improvement in these patches. --- C4/Accounts.pm | 2 +- C4/ClassSource.pm | 66 ++++++++++++---------------- t/lib/KohaTest/ClassSource.pm | 34 +++++++++++++++ t/lib/KohaTest/ClassSource/ClassSource.pm | 56 ++++++++++++++++++++++++ 4 files changed, 119 insertions(+), 39 deletions(-) create mode 100644 t/lib/KohaTest/ClassSource.pm create mode 100644 t/lib/KohaTest/ClassSource/ClassSource.pm diff --git a/C4/Accounts.pm b/C4/Accounts.pm index c43741b..4050124 100644 --- a/C4/Accounts.pm +++ b/C4/Accounts.pm @@ -23,7 +23,7 @@ use C4::Context; use C4::Stats; use C4::Members; use C4::Items; -use C4::Circulation qw(MarkIssueReturned); +use C4::Circulation; use vars qw($VERSION @ISA @EXPORT); diff --git a/C4/ClassSource.pm b/C4/ClassSource.pm index 4a161ae..4db0656 100644 --- a/C4/ClassSource.pm +++ b/C4/ClassSource.pm @@ -64,6 +64,9 @@ sources and sorting rules. ); +use C4::Schema; +our $schema = C4::Schema->connect(); + =head2 GetClassSources my $sources = GetClassSources(); @@ -91,13 +94,11 @@ foreach my $cn_source (sort keys %$sources) { sub GetClassSources { my %class_sources = (); - my $dbh = C4::Context->dbh; - my $sth = $dbh->prepare_cached("SELECT * FROM `class_sources`"); - $sth->execute(); - while (my $source = $sth->fetchrow_hashref) { - $class_sources{ $source->{'cn_source'} } = $source; + + my @class_sources = $schema->resultset('ClassSources')->search(); + foreach my $row ( @class_sources ) { + $class_sources{ $row->get_column('cn_source') } = { $row->get_columns }; } - $sth->finish(); return \%class_sources; @@ -112,15 +113,14 @@ sub GetClassSources { =cut sub AddClassSource { - - my ($cn_source, $description, $used, $class_sort_rule) = @_; - my $dbh = C4::Context->dbh; - my $sth = $dbh->prepare_cached("INSERT INTO `class_sources` - (`cn_source`, `description`, `used`, `class_sort_rule`) - VALUES (?, ?, ?, ?)"); - $sth->execute($cn_source, $description, $used, $class_sort_rule); - $sth->finish(); - + my ( $cn_source, $description, $used, $class_sort_rule ) = @_; + my $new_cs = $schema->resultset('ClassSources')->create( + { cn_source => $cn_source, + description => $description, + used => $used, + class_sort_rule => $class_sort_rule + } + ); } =head2 GetClassSource @@ -132,14 +132,12 @@ sub AddClassSource { =cut sub GetClassSource { + my $cn_source = shift; - my ($cn_source) = (@_); - my $dbh = C4::Context->dbh; - my $sth = $dbh->prepare_cached("SELECT * FROM `class_sources` WHERE cn_source = ?"); - $sth->execute($cn_source); - my $row = $sth->fetchrow_hashref(); - $sth->finish(); - return $row; + my $rs = $schema->resultset('ClassSources')->find( $cn_source ); + return unless defined $rs; # in case this one doesn't exist. + my %class_source = $rs->get_columns; + return \%class_source; } =head2 ModClassSource @@ -151,17 +149,14 @@ sub GetClassSource { =cut sub ModClassSource { - my ($cn_source, $description, $used, $class_sort_rule) = @_; - my $dbh = C4::Context->dbh; - my $sth = $dbh->prepare_cached("UPDATE `class_sources` - SET `description` = ?, - `used` = ?, - `class_sort_rule` = ? - WHERE `cn_source` = ?"); - $sth->execute($description, $used, $class_sort_rule, $cn_source); - $sth->finish(); + my $cs = $schema->resultset('ClassSources')->find( $cn_source ); + return unless defined $cs; # in case this one doesn't exist. + $cs->set_column( description => $description ); + $cs->set_column( used => $used ); + $cs->set_column( class_sort_rule => $class_sort_rule ); + return $cs->update(); } =head2 DelClassSource @@ -173,13 +168,8 @@ sub ModClassSource { =cut sub DelClassSource { - - my ($cn_source) = @_; - my $dbh = C4::Context->dbh; - my $sth = $dbh->prepare_cached("DELETE FROM `class_sources` WHERE `cn_source` = ?"); - $sth->execute($cn_source); - $sth->finish(); - + my $cn_source = shift; + my $deleted = $schema->resultset('ClassSources')->find( $cn_source )->delete; } =head2 GetClassSortRules diff --git a/t/lib/KohaTest/ClassSource.pm b/t/lib/KohaTest/ClassSource.pm new file mode 100644 index 0000000..227272b --- /dev/null +++ b/t/lib/KohaTest/ClassSource.pm @@ -0,0 +1,34 @@ +package KohaTest::ClassSource; +use base qw( KohaTest ); + +use strict; +use warnings; + +use Test::More; + +use C4::Members; +sub testing_class { 'C4::ClassSource' }; + + +sub methods : Test( 1 ) { + my $self = shift; + my @methods = qw( + GetClassSources + AddClassSource + GetClassSource + ModClassSource + DelClassSource + GetClassSortRules + AddClassSortRule + GetClassSortRule + ModClassSortRule + DelClassSortRule + GetSourcesForSortRule + GetClassSort + ); + + can_ok( $self->testing_class, @methods ); +} + +1; + diff --git a/t/lib/KohaTest/ClassSource/ClassSource.pm b/t/lib/KohaTest/ClassSource/ClassSource.pm new file mode 100644 index 0000000..e15638c --- /dev/null +++ b/t/lib/KohaTest/ClassSource/ClassSource.pm @@ -0,0 +1,56 @@ +package KohaTest::ClassSource::ClassSource; +use base qw( KohaTest::ClassSource ); + +use strict; +use warnings; + +use Test::More; + +use C4::ClassSource; + +sub round_trip : Test(8) { + my $self = shift; + + my $example = { + cn_source => 'foo', + class_sort_rule => 'generic', + used => '0', + description => 'example for testing' + }; + + my $not_there = GetClassSource( $example->{'cn_source'} ); + ok( ! defined( $not_there ), 'our example is not there to start with' ) or + warn( Data::Dumper->Dump( [ $not_there ], [ 'not_there' ] ) ); + + my $added = AddClassSource( $example->{'cn_source'}, $example->{'description'}, $example->{'used'}, $example->{'class_sort_rule'} ); + ok( $added, 'added' ); + + my $there = GetClassSource( $example->{'cn_source'} ); + is_deeply( $there, $example, 'the one we got back is the same as the one we sent in' ); + + my $class_sources = GetClassSources(); + is_deeply( $class_sources->{ $example->{'cn_source'} }, $example ) + or warn( Data::Dumper->Dump( [ $class_sources ], [ 'class_sources' ] ) ); + + my $modified_example = { + cn_source => $example->{'cn_source'}, + class_sort_rule => 'dewey', + used => '1', + description => 'modified example for testing', + }; + + my $modified = ModClassSource( $modified_example->{'cn_source'}, $modified_example->{'description'}, $modified_example->{'used'}, $modified_example->{'class_sort_rule'} ); + ok( $modified, 'modified' ); + + my $found_modified = GetClassSource( $modified_example->{'cn_source'} ); + is_deeply( $found_modified, $modified_example, 'the one we got back is the same as the one we sent in' ); + + my $deleted = DelClassSource( $modified_example->{'cn_source'} ); + ok( $deleted, 'deleted' ); + + my $not_found = GetClassSource( $modified_example->{'cn_source'} ); + ok( ! defined( $not_found ), 'deleted' ); + +} + +1; -- 1.5.6
Here are some changes that can be made to the C4::Members class to start moving away from writing our own SQL and towards using the C4::Schema object built with DBIx::Class. Though I haven't replaced many methods in this class, I'm chosing this one because it's more complex than the C4::ClassSource example and may show some more aspects of my proposed change. --- C4/Members.pm | 25 +++++++++++-------------- 1 files changed, 11 insertions(+), 14 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index e756ffb..c9cbd0d 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -108,6 +108,9 @@ BEGIN { ); } +use C4::Schema; +our $schema = C4::Schema->connect(); + =head1 NAME C4::Members - Perl Module containing convenience functions for member handling @@ -592,7 +595,7 @@ sub GetMemberIssuesAndFines { } sub columns(;$) { - return @{C4::Context->dbh->selectcol_arrayref("SHOW columns from borrowers")}; + return $schema->source('Borrowers')->columns; } =head2 @@ -633,9 +636,9 @@ sub ModMember { } my @columns = &columns; my %hashborrowerfields = (map {$_=>1} @columns); - my $query = "UPDATE borrowers SET \n"; - my $sth; - my @parameters; + + my $borrower = $schema->resultset('Borrowers')->find( $data{'borrowernumber'} ); + return unless $borrower; # that member must not exist. # test to know if you must update or not the borrower password if (exists $data{password}) { @@ -649,21 +652,15 @@ sub ModMember { foreach (keys %data) { next if ($_ eq 'borrowernumber' or $_ eq 'flags'); if ($hashborrowerfields{$_}){ - $query .= " $_=?, "; - push @parameters,$data{$_}; + $borrower->set_column( $_, $data{$_} ); } else { push @badkeys, $_; delete $data{$_}; } } (@badkeys) and warn scalar(@badkeys) . " Illegal key(s) passed to ModMember: " . join(',',@badkeys); - $query =~ s/, $//; - $query .= " WHERE borrowernumber=?"; - push @parameters, $data{'borrowernumber'}; - $debug and print STDERR "$query (executed w/ arg: $data{'borrowernumber'})"; - $sth = $dbh->prepare($query); - my $execute_success = $sth->execute(@parameters); - $sth->finish; + $debug and print STDERR "updating borrower: $data{'borrowernumber'}"; + my $execute_success = $borrower->update(); # ok if its an adult (type) it may have borrowers that depend on it as a guarantor # so when we update information for an adult we should check for guarantees and update the relevant part @@ -673,7 +670,7 @@ sub ModMember { # is adult check guarantees; UpdateGuarantees(%data); } - logaction("MEMBERS", "MODIFY", $data{'borrowernumber'}, "$query (executed w/ arg: $data{'borrowernumber'})") + logaction("MEMBERS", "MODIFY", $data{'borrowernumber'}, "modified borrower: $data{'borrowernumber'}") if C4::Context->preference("BorrowersLog"); return $execute_success; -- 1.5.6
Here's an update to the proposal I sent last week about starting to use DBIx::Class as an interface to our database. I've made some updates and fixed some problems, and think that this is getting close to being ready to apply to Koha. I'm interested in hearing what you other developers think of this idea. Perhaps you can help me improve it before we commit to it. Changes since last time: * I'm including a misc/bin/make_schema.pl script that scans our database and makes a set of perl modules that represent the database. This is the recommended usage of the module and prevents it from having to scan the entire database with each usage as it was doing last time. This program will have to be run each time we change our schema with the updatedatabase.pl and kohastructure.sql files. * I fixed a few bugs, like the one that conflicted with our unusual use of Exporter. * I included a bunch of test scripts that I left out last time. As a reminder, here is a brief summary of some of the advantages to starting to use DBIx::Class: * This will get us out of the business of writing SQL queries ourselves and delegate that responsibility to the DBIx::Class modules, which are more likely to write correct, efficient SQL code than I am. * This will simplify many spots in or code simply by removing some of the database maintenance things that we do, like checking for the last auto_increment value. DBIx::Class knows about that kind of thing and returns it for you. * By removing much of our SQL code, we would be removing much of the code that is specific to MySQL, making it easier to eventually support other databases. There are of course drawbacks, among them: * There may be a perfoamce penalty to using DBIx::Class. I have not measured anything to see if there is or not. * DBIx::Class would be a new dependency. DBIx::Class::Schema::Loader would be a new dependency for develpers, though end-users would not need to have it installed. I encourage you to apply these patches, or at least look through them to see how things would change. I would be interesetd in hearing about how we could use DBIx::Class differently, other alternatives to it, or why we should not persue this type of tool at all. Thanks! -Andy Andrew Moore (5): DBIx::Class - ACM-DEVELOPMENT: adjusting t/Makefile to find private library - DO NOT COMMIT DBIx::Class - new C4::Schema object and program to manage C4::Schema::* objects DBIx::Class - C4::Schema::* objects automatically generated DBix::Class - moving C4::ClassSource over to using DBIx::Class DBIx::Class - Changes to C4::Members to start using DBIx::Class C4/ClassSource.pm | 66 ++-- C4/Members.pm | 25 +- C4/Schema.pm | 68 +++ C4/Schema/Result/Accountlines.pm | 85 ++++ C4/Schema/Result/Accountoffsets.pm | 44 ++ C4/Schema/Result/ActionLogs.pm | 54 +++ C4/Schema/Result/Alert.pm | 28 ++ C4/Schema/Result/Aqbasket.pm | 52 +++ C4/Schema/Result/Aqbookfund.pm | 38 ++ C4/Schema/Result/Aqbooksellers.pm | 249 +++++++++++ C4/Schema/Result/Aqbudget.pm | 47 ++ C4/Schema/Result/Aqorderbreakdown.pm | 49 +++ C4/Schema/Result/Aqorderdelivery.pm | 44 ++ C4/Schema/Result/Aqorders.pm | 188 ++++++++ C4/Schema/Result/AuthHeader.pm | 58 +++ C4/Schema/Result/AuthSubfieldStructure.pm | 67 +++ C4/Schema/Result/AuthTagStructure.pm | 44 ++ C4/Schema/Result/AuthTypes.pm | 38 ++ C4/Schema/Result/AuthorisedValues.pm | 40 ++ C4/Schema/Result/Biblio.pm | 124 ++++++ C4/Schema/Result/BiblioFramework.pm | 24 + C4/Schema/Result/Biblioitems.pm | 229 ++++++++++ C4/Schema/Result/BorrowerAttributeTypes.pm | 46 ++ C4/Schema/Result/BorrowerAttributes.pm | 47 ++ C4/Schema/Result/BorrowerMessagePreferences.pm | 47 ++ .../Result/BorrowerMessageTransportPreferences.pm | 36 ++ C4/Schema/Result/Borrowers.pm | 452 ++++++++++++++++++++ C4/Schema/Result/BranchBorrowerCircRules.pm | 36 ++ C4/Schema/Result/Branchcategories.pm | 48 ++ C4/Schema/Result/Branches.pm | 137 ++++++ C4/Schema/Result/Branchrelations.pm | 34 ++ C4/Schema/Result/Branchtransfers.pm | 61 +++ C4/Schema/Result/Browser.pm | 29 ++ C4/Schema/Result/Categories.pm | 95 ++++ C4/Schema/Result/Cities.pm | 31 ++ C4/Schema/Result/ClassSortRules.pm | 37 ++ C4/Schema/Result/ClassSources.pm | 39 ++ C4/Schema/Result/Currency.pm | 43 ++ C4/Schema/Result/DefaultBorrowerCircRules.pm | 29 ++ C4/Schema/Result/DefaultBranchCircRules.pm | 29 ++ C4/Schema/Result/DefaultCircRules.pm | 29 ++ C4/Schema/Result/Deletedbiblio.pm | 84 ++++ C4/Schema/Result/Deletedbiblioitems.pm | 219 ++++++++++ C4/Schema/Result/Deletedborrowers.pm | 353 +++++++++++++++ C4/Schema/Result/Deleteditems.pm | 206 +++++++++ C4/Schema/Result/Ethnicity.pm | 29 ++ C4/Schema/Result/HoldFillTargets.pm | 55 +++ C4/Schema/Result/ImportBatches.pm | 93 ++++ C4/Schema/Result/ImportBiblios.pm | 67 +++ C4/Schema/Result/ImportItems.pm | 54 +++ C4/Schema/Result/ImportRecordMatches.pm | 30 ++ C4/Schema/Result/ImportRecords.pm | 115 +++++ C4/Schema/Result/Issues.pm | 66 +++ C4/Schema/Result/Issuingrules.pm | 66 +++ C4/Schema/Result/Items.pm | 250 +++++++++++ C4/Schema/Result/Itemtypes.pm | 60 +++ C4/Schema/Result/Labels.pm | 33 ++ C4/Schema/Result/LabelsConf.pm | 71 +++ C4/Schema/Result/LabelsProfile.pm | 25 ++ C4/Schema/Result/LabelsTemplates.pm | 59 +++ C4/Schema/Result/LanguageDescriptions.pm | 47 ++ C4/Schema/Result/LanguageRfc4646ToIso639.pm | 33 ++ C4/Schema/Result/LanguageScriptBidi.pm | 28 ++ C4/Schema/Result/LanguageScriptMapping.pm | 33 ++ C4/Schema/Result/LanguageSubtagRegistry.pm | 42 ++ C4/Schema/Result/Letter.pm | 43 ++ C4/Schema/Result/MarcMatchers.pm | 50 +++ C4/Schema/Result/MarcSubfieldStructure.pm | 89 ++++ C4/Schema/Result/MarcTagStructure.pm | 39 ++ C4/Schema/Result/Matchchecks.pm | 43 ++ C4/Schema/Result/MatcherMatchpoints.pm | 33 ++ C4/Schema/Result/MatchpointComponentNorms.pm | 30 ++ C4/Schema/Result/MatchpointComponents.pm | 46 ++ C4/Schema/Result/Matchpoints.pm | 53 +++ C4/Schema/Result/MessageAttributes.pm | 37 ++ C4/Schema/Result/MessageQueue.pm | 84 ++++ C4/Schema/Result/MessageTransportTypes.pm | 43 ++ C4/Schema/Result/MessageTransports.pm | 45 ++ C4/Schema/Result/Notifys.pm | 33 ++ C4/Schema/Result/Nozebra.pm | 32 ++ C4/Schema/Result/OldIssues.pm | 66 +++ C4/Schema/Result/OldReserves.pm | 82 ++++ C4/Schema/Result/OpacNews.pm | 39 ++ C4/Schema/Result/Overduerules.pm | 57 +++ C4/Schema/Result/Patroncards.pm | 38 ++ C4/Schema/Result/Patronimage.pm | 36 ++ C4/Schema/Result/Permissions.pm | 44 ++ C4/Schema/Result/Printers.pm | 36 ++ C4/Schema/Result/PrintersProfile.pm | 44 ++ C4/Schema/Result/RepeatableHolidays.pm | 49 +++ C4/Schema/Result/ReportsDictionary.pm | 59 +++ C4/Schema/Result/Reserveconstraints.pm | 34 ++ C4/Schema/Result/Reserves.pm | 87 ++++ C4/Schema/Result/Reviews.pm | 42 ++ C4/Schema/Result/Roadtype.pm | 24 + C4/Schema/Result/SavedReports.pm | 38 ++ C4/Schema/Result/SavedSql.pm | 73 ++++ C4/Schema/Result/Serial.pm | 62 +++ C4/Schema/Result/Serialitems.pm | 29 ++ C4/Schema/Result/ServicesThrottle.pm | 29 ++ C4/Schema/Result/Sessions.pm | 24 + C4/Schema/Result/SpecialHolidays.pm | 36 ++ C4/Schema/Result/Statistics.pm | 71 +++ C4/Schema/Result/Stopwords.pm | 26 ++ C4/Schema/Result/Subscription.pm | 147 +++++++ C4/Schema/Result/Subscriptionhistory.pm | 46 ++ C4/Schema/Result/Subscriptionroutinglist.pm | 28 ++ C4/Schema/Result/Suggestions.pm | 104 +++++ C4/Schema/Result/Systempreferences.pm | 50 +++ C4/Schema/Result/Tags.pm | 24 + C4/Schema/Result/TagsAll.pm | 42 ++ C4/Schema/Result/TagsApproval.pm | 45 ++ C4/Schema/Result/TagsIndex.pm | 32 ++ C4/Schema/Result/TmpHoldsqueue.pm | 99 +++++ C4/Schema/Result/UserPermissions.pm | 40 ++ C4/Schema/Result/Userflags.pm | 43 ++ C4/Schema/Result/Virtualshelfcontents.pm | 42 ++ C4/Schema/Result/Virtualshelves.pm | 57 +++ C4/Schema/Result/Z3950servers.pm | 100 +++++ C4/Schema/Result/Zebraqueue.pm | 37 ++ misc/bin/make_schema.pl | 70 +++ t/Makefile | 2 +- t/lib/KohaTest/ClassSource.pm | 34 ++ t/lib/KohaTest/ClassSource/ClassSource.pm | 56 +++ 124 files changed, 7954 insertions(+), 53 deletions(-) create mode 100644 C4/Schema.pm create mode 100644 C4/Schema/Result/Accountlines.pm create mode 100644 C4/Schema/Result/Accountoffsets.pm create mode 100644 C4/Schema/Result/ActionLogs.pm create mode 100644 C4/Schema/Result/Alert.pm create mode 100644 C4/Schema/Result/Aqbasket.pm create mode 100644 C4/Schema/Result/Aqbookfund.pm create mode 100644 C4/Schema/Result/Aqbooksellers.pm create mode 100644 C4/Schema/Result/Aqbudget.pm create mode 100644 C4/Schema/Result/Aqorderbreakdown.pm create mode 100644 C4/Schema/Result/Aqorderdelivery.pm create mode 100644 C4/Schema/Result/Aqorders.pm create mode 100644 C4/Schema/Result/AuthHeader.pm create mode 100644 C4/Schema/Result/AuthSubfieldStructure.pm create mode 100644 C4/Schema/Result/AuthTagStructure.pm create mode 100644 C4/Schema/Result/AuthTypes.pm create mode 100644 C4/Schema/Result/AuthorisedValues.pm create mode 100644 C4/Schema/Result/Biblio.pm create mode 100644 C4/Schema/Result/BiblioFramework.pm create mode 100644 C4/Schema/Result/Biblioitems.pm create mode 100644 C4/Schema/Result/BorrowerAttributeTypes.pm create mode 100644 C4/Schema/Result/BorrowerAttributes.pm create mode 100644 C4/Schema/Result/BorrowerMessagePreferences.pm create mode 100644 C4/Schema/Result/BorrowerMessageTransportPreferences.pm create mode 100644 C4/Schema/Result/Borrowers.pm create mode 100644 C4/Schema/Result/BranchBorrowerCircRules.pm create mode 100644 C4/Schema/Result/Branchcategories.pm create mode 100644 C4/Schema/Result/Branches.pm create mode 100644 C4/Schema/Result/Branchrelations.pm create mode 100644 C4/Schema/Result/Branchtransfers.pm create mode 100644 C4/Schema/Result/Browser.pm create mode 100644 C4/Schema/Result/Categories.pm create mode 100644 C4/Schema/Result/Cities.pm create mode 100644 C4/Schema/Result/ClassSortRules.pm create mode 100644 C4/Schema/Result/ClassSources.pm create mode 100644 C4/Schema/Result/Currency.pm create mode 100644 C4/Schema/Result/DefaultBorrowerCircRules.pm create mode 100644 C4/Schema/Result/DefaultBranchCircRules.pm create mode 100644 C4/Schema/Result/DefaultCircRules.pm create mode 100644 C4/Schema/Result/Deletedbiblio.pm create mode 100644 C4/Schema/Result/Deletedbiblioitems.pm create mode 100644 C4/Schema/Result/Deletedborrowers.pm create mode 100644 C4/Schema/Result/Deleteditems.pm create mode 100644 C4/Schema/Result/Ethnicity.pm create mode 100644 C4/Schema/Result/HoldFillTargets.pm create mode 100644 C4/Schema/Result/ImportBatches.pm create mode 100644 C4/Schema/Result/ImportBiblios.pm create mode 100644 C4/Schema/Result/ImportItems.pm create mode 100644 C4/Schema/Result/ImportRecordMatches.pm create mode 100644 C4/Schema/Result/ImportRecords.pm create mode 100644 C4/Schema/Result/Issues.pm create mode 100644 C4/Schema/Result/Issuingrules.pm create mode 100644 C4/Schema/Result/Items.pm create mode 100644 C4/Schema/Result/Itemtypes.pm create mode 100644 C4/Schema/Result/Labels.pm create mode 100644 C4/Schema/Result/LabelsConf.pm create mode 100644 C4/Schema/Result/LabelsProfile.pm create mode 100644 C4/Schema/Result/LabelsTemplates.pm create mode 100644 C4/Schema/Result/LanguageDescriptions.pm create mode 100644 C4/Schema/Result/LanguageRfc4646ToIso639.pm create mode 100644 C4/Schema/Result/LanguageScriptBidi.pm create mode 100644 C4/Schema/Result/LanguageScriptMapping.pm create mode 100644 C4/Schema/Result/LanguageSubtagRegistry.pm create mode 100644 C4/Schema/Result/Letter.pm create mode 100644 C4/Schema/Result/MarcMatchers.pm create mode 100644 C4/Schema/Result/MarcSubfieldStructure.pm create mode 100644 C4/Schema/Result/MarcTagStructure.pm create mode 100644 C4/Schema/Result/Matchchecks.pm create mode 100644 C4/Schema/Result/MatcherMatchpoints.pm create mode 100644 C4/Schema/Result/MatchpointComponentNorms.pm create mode 100644 C4/Schema/Result/MatchpointComponents.pm create mode 100644 C4/Schema/Result/Matchpoints.pm create mode 100644 C4/Schema/Result/MessageAttributes.pm create mode 100644 C4/Schema/Result/MessageQueue.pm create mode 100644 C4/Schema/Result/MessageTransportTypes.pm create mode 100644 C4/Schema/Result/MessageTransports.pm create mode 100644 C4/Schema/Result/Notifys.pm create mode 100644 C4/Schema/Result/Nozebra.pm create mode 100644 C4/Schema/Result/OldIssues.pm create mode 100644 C4/Schema/Result/OldReserves.pm create mode 100644 C4/Schema/Result/OpacNews.pm create mode 100644 C4/Schema/Result/Overduerules.pm create mode 100644 C4/Schema/Result/Patroncards.pm create mode 100644 C4/Schema/Result/Patronimage.pm create mode 100644 C4/Schema/Result/Permissions.pm create mode 100644 C4/Schema/Result/Printers.pm create mode 100644 C4/Schema/Result/PrintersProfile.pm create mode 100644 C4/Schema/Result/RepeatableHolidays.pm create mode 100644 C4/Schema/Result/ReportsDictionary.pm create mode 100644 C4/Schema/Result/Reserveconstraints.pm create mode 100644 C4/Schema/Result/Reserves.pm create mode 100644 C4/Schema/Result/Reviews.pm create mode 100644 C4/Schema/Result/Roadtype.pm create mode 100644 C4/Schema/Result/SavedReports.pm create mode 100644 C4/Schema/Result/SavedSql.pm create mode 100644 C4/Schema/Result/Serial.pm create mode 100644 C4/Schema/Result/Serialitems.pm create mode 100644 C4/Schema/Result/ServicesThrottle.pm create mode 100644 C4/Schema/Result/Sessions.pm create mode 100644 C4/Schema/Result/SpecialHolidays.pm create mode 100644 C4/Schema/Result/Statistics.pm create mode 100644 C4/Schema/Result/Stopwords.pm create mode 100644 C4/Schema/Result/Subscription.pm create mode 100644 C4/Schema/Result/Subscriptionhistory.pm create mode 100644 C4/Schema/Result/Subscriptionroutinglist.pm create mode 100644 C4/Schema/Result/Suggestions.pm create mode 100644 C4/Schema/Result/Systempreferences.pm create mode 100644 C4/Schema/Result/Tags.pm create mode 100644 C4/Schema/Result/TagsAll.pm create mode 100644 C4/Schema/Result/TagsApproval.pm create mode 100644 C4/Schema/Result/TagsIndex.pm create mode 100644 C4/Schema/Result/TmpHoldsqueue.pm create mode 100644 C4/Schema/Result/UserPermissions.pm create mode 100644 C4/Schema/Result/Userflags.pm create mode 100644 C4/Schema/Result/Virtualshelfcontents.pm create mode 100644 C4/Schema/Result/Virtualshelves.pm create mode 100644 C4/Schema/Result/Z3950servers.pm create mode 100644 C4/Schema/Result/Zebraqueue.pm create mode 100755 misc/bin/make_schema.pl create mode 100644 t/lib/KohaTest/ClassSource.pm create mode 100644 t/lib/KohaTest/ClassSource/ClassSource.pm
This patch includes a misc/bin/make_schema.pl program that uses DBIx::Class::Schema::Loader to read the database and produce some modules that act as an interface to it. This program is designed to be run each time we change the schema definition in kohastructure.sql and updatedatabase.pl. It manages the classes in C4/Schema/Result/. This patch also includes a C4::Schema object that can use those generated classes as our interface to the database. This module is different from my previous example in that it does not load the database schema upon each request, but relies on the C4::Schema::Result::* objects to describe the database. The top portion of this module is automatically generated by misc/bin/make_schema.pl. --- C4/Schema.pm | 68 +++++++++++++++++++++++++++++++++++++++++++++ misc/bin/make_schema.pl | 70 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 138 insertions(+), 0 deletions(-) create mode 100644 C4/Schema.pm create mode 100755 misc/bin/make_schema.pl diff --git a/C4/Schema.pm b/C4/Schema.pm new file mode 100644 index 0000000..61841f1 --- /dev/null +++ b/C4/Schema.pm @@ -0,0 +1,68 @@ +package C4::Schema; + +use strict; +use warnings; + +use base 'DBIx::Class::Schema'; + +__PACKAGE__->load_namespaces; + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:psTYqCIO60Z8q1xG4a9TaQ + + + +# Copyright 2008 LibLime, Inc. +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + +=head1 NAME + +C4::Schema - The DBIx::Class interface to Koha's database schema. + +=head1 SYNOPSIS + +use C4::Schema; +our $schema = C4::Schema->connect(); + +=head1 DESCRIPTION + +This module provides an object oriented interface to the Koha +database. It uses the modles that are automatically generated into the +C4/Schema directory and allows database interaction without writing +SQL. + +=cut + +my $context = C4::Context->new(); + +my $db_driver = 'mysql'; +my $db_name = $context->config('database'); +my $db_host = $context->config('hostname'); +my $db_port = $context->config('port') || ''; +my $db_user = $context->config('user'); +my $db_passwd = $context->config('pass'); + +sub connect { + my $self = shift; + return $self->SUPER::connect( "DBI:$db_driver:dbname=$db_name;host=$db_host;port=$db_port", + $db_user, $db_passwd ); +} + + +1; + diff --git a/misc/bin/make_schema.pl b/misc/bin/make_schema.pl new file mode 100755 index 0000000..8224fe9 --- /dev/null +++ b/misc/bin/make_schema.pl @@ -0,0 +1,70 @@ +#!/usr/bin/env perl + +# Copyright 2008 LibLime, Inc. +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + +=head1 NAME + +make_schema.pl - create database schema modules to be used by DBIx::Class + +=head1 SYNOPSIS + +make_schema.pl + +=head1 DESCRIPTION + +B<make_schema.pl> reads the schema in the current database and creates +a directory of perl modules used to interact with that database. It's +to be run after database schema changes are made, typically when +checking in changes to L<updatedatabase.pl> and +L<kohastrucuture.sql>. The files output will appear in the C4/Schema +directory. + +=head1 SEE ALSO + +The L<C4::Schema> module uses the files created by this program. + +<DBIx::Class::Schema::Loader> + +=cut + +use warnings; +use strict; + +use DBIx::Class::Schema::Loader qw( make_schema_at dump_to_dir:. ); + +use C4::Context; + +my $context = C4::Context->new(); + +my $db_driver = 'mysql'; +my $db_name = $context->config('database'); +my $db_host = $context->config('hostname'); +my $db_port = $context->config('port') || ''; +my $db_user = $context->config('user'); +my $db_passwd = $context->config('pass'); + +make_schema_at( + 'C4::Schema', + { debug => 0, + use_namespaces => 1, + components => ['InflateColumn::DateTime'], + # really_erase_my_files => 1, + }, + [ "DBI:$db_driver:dbname=$db_name;host=$db_host;port=$db_port", $db_user, $db_passwd ] +); + -- 1.5.6
This patch includes the first iteration of the C4::Schema::Result::* classes that describe our database and allow the DBIx::Class interface to it. These were generated using the misc/tools/make_schema.pl program. They should be updated by using make_schema.pl each time we change the schema in kohastructure.sql and updatedatabase.pl. --- C4/Schema/Result/Accountlines.pm | 85 ++++ C4/Schema/Result/Accountoffsets.pm | 44 ++ C4/Schema/Result/ActionLogs.pm | 54 +++ C4/Schema/Result/Alert.pm | 28 ++ C4/Schema/Result/Aqbasket.pm | 52 +++ C4/Schema/Result/Aqbookfund.pm | 38 ++ C4/Schema/Result/Aqbooksellers.pm | 249 +++++++++++ C4/Schema/Result/Aqbudget.pm | 47 ++ C4/Schema/Result/Aqorderbreakdown.pm | 49 +++ C4/Schema/Result/Aqorderdelivery.pm | 44 ++ C4/Schema/Result/Aqorders.pm | 188 ++++++++ C4/Schema/Result/AuthHeader.pm | 58 +++ C4/Schema/Result/AuthSubfieldStructure.pm | 67 +++ C4/Schema/Result/AuthTagStructure.pm | 44 ++ C4/Schema/Result/AuthTypes.pm | 38 ++ C4/Schema/Result/AuthorisedValues.pm | 40 ++ C4/Schema/Result/Biblio.pm | 124 ++++++ C4/Schema/Result/BiblioFramework.pm | 24 + C4/Schema/Result/Biblioitems.pm | 229 ++++++++++ C4/Schema/Result/BorrowerAttributeTypes.pm | 46 ++ C4/Schema/Result/BorrowerAttributes.pm | 47 ++ C4/Schema/Result/BorrowerMessagePreferences.pm | 47 ++ .../Result/BorrowerMessageTransportPreferences.pm | 36 ++ C4/Schema/Result/Borrowers.pm | 452 ++++++++++++++++++++ C4/Schema/Result/BranchBorrowerCircRules.pm | 36 ++ C4/Schema/Result/Branchcategories.pm | 48 ++ C4/Schema/Result/Branches.pm | 137 ++++++ C4/Schema/Result/Branchrelations.pm | 34 ++ C4/Schema/Result/Branchtransfers.pm | 61 +++ C4/Schema/Result/Browser.pm | 29 ++ C4/Schema/Result/Categories.pm | 95 ++++ C4/Schema/Result/Cities.pm | 31 ++ C4/Schema/Result/ClassSortRules.pm | 37 ++ C4/Schema/Result/ClassSources.pm | 39 ++ C4/Schema/Result/Currency.pm | 43 ++ C4/Schema/Result/DefaultBorrowerCircRules.pm | 29 ++ C4/Schema/Result/DefaultBranchCircRules.pm | 29 ++ C4/Schema/Result/DefaultCircRules.pm | 29 ++ C4/Schema/Result/Deletedbiblio.pm | 84 ++++ C4/Schema/Result/Deletedbiblioitems.pm | 219 ++++++++++ C4/Schema/Result/Deletedborrowers.pm | 353 +++++++++++++++ C4/Schema/Result/Deleteditems.pm | 206 +++++++++ C4/Schema/Result/Ethnicity.pm | 29 ++ C4/Schema/Result/HoldFillTargets.pm | 55 +++ C4/Schema/Result/ImportBatches.pm | 93 ++++ C4/Schema/Result/ImportBiblios.pm | 67 +++ C4/Schema/Result/ImportItems.pm | 54 +++ C4/Schema/Result/ImportRecordMatches.pm | 30 ++ C4/Schema/Result/ImportRecords.pm | 115 +++++ C4/Schema/Result/Issues.pm | 66 +++ C4/Schema/Result/Issuingrules.pm | 66 +++ C4/Schema/Result/Items.pm | 250 +++++++++++ C4/Schema/Result/Itemtypes.pm | 60 +++ C4/Schema/Result/Labels.pm | 33 ++ C4/Schema/Result/LabelsConf.pm | 71 +++ C4/Schema/Result/LabelsProfile.pm | 25 ++ C4/Schema/Result/LabelsTemplates.pm | 59 +++ C4/Schema/Result/LanguageDescriptions.pm | 47 ++ C4/Schema/Result/LanguageRfc4646ToIso639.pm | 33 ++ C4/Schema/Result/LanguageScriptBidi.pm | 28 ++ C4/Schema/Result/LanguageScriptMapping.pm | 33 ++ C4/Schema/Result/LanguageSubtagRegistry.pm | 42 ++ C4/Schema/Result/Letter.pm | 43 ++ C4/Schema/Result/MarcMatchers.pm | 50 +++ C4/Schema/Result/MarcSubfieldStructure.pm | 89 ++++ C4/Schema/Result/MarcTagStructure.pm | 39 ++ C4/Schema/Result/Matchchecks.pm | 43 ++ C4/Schema/Result/MatcherMatchpoints.pm | 33 ++ C4/Schema/Result/MatchpointComponentNorms.pm | 30 ++ C4/Schema/Result/MatchpointComponents.pm | 46 ++ C4/Schema/Result/Matchpoints.pm | 53 +++ C4/Schema/Result/MessageAttributes.pm | 37 ++ C4/Schema/Result/MessageQueue.pm | 84 ++++ C4/Schema/Result/MessageTransportTypes.pm | 43 ++ C4/Schema/Result/MessageTransports.pm | 45 ++ C4/Schema/Result/Notifys.pm | 33 ++ C4/Schema/Result/Nozebra.pm | 32 ++ C4/Schema/Result/OldIssues.pm | 66 +++ C4/Schema/Result/OldReserves.pm | 82 ++++ C4/Schema/Result/OpacNews.pm | 39 ++ C4/Schema/Result/Overduerules.pm | 57 +++ C4/Schema/Result/Patroncards.pm | 38 ++ C4/Schema/Result/Patronimage.pm | 36 ++ C4/Schema/Result/Permissions.pm | 44 ++ C4/Schema/Result/Printers.pm | 36 ++ C4/Schema/Result/PrintersProfile.pm | 44 ++ C4/Schema/Result/RepeatableHolidays.pm | 49 +++ C4/Schema/Result/ReportsDictionary.pm | 59 +++ C4/Schema/Result/Reserveconstraints.pm | 34 ++ C4/Schema/Result/Reserves.pm | 87 ++++ C4/Schema/Result/Reviews.pm | 42 ++ C4/Schema/Result/Roadtype.pm | 24 + C4/Schema/Result/SavedReports.pm | 38 ++ C4/Schema/Result/SavedSql.pm | 73 ++++ C4/Schema/Result/Serial.pm | 62 +++ C4/Schema/Result/Serialitems.pm | 29 ++ C4/Schema/Result/ServicesThrottle.pm | 29 ++ C4/Schema/Result/Sessions.pm | 24 + C4/Schema/Result/SpecialHolidays.pm | 36 ++ C4/Schema/Result/Statistics.pm | 71 +++ C4/Schema/Result/Stopwords.pm | 26 ++ C4/Schema/Result/Subscription.pm | 147 +++++++ C4/Schema/Result/Subscriptionhistory.pm | 46 ++ C4/Schema/Result/Subscriptionroutinglist.pm | 28 ++ C4/Schema/Result/Suggestions.pm | 104 +++++ C4/Schema/Result/Systempreferences.pm | 50 +++ C4/Schema/Result/Tags.pm | 24 + C4/Schema/Result/TagsAll.pm | 42 ++ C4/Schema/Result/TagsApproval.pm | 45 ++ C4/Schema/Result/TagsIndex.pm | 32 ++ C4/Schema/Result/TmpHoldsqueue.pm | 99 +++++ C4/Schema/Result/UserPermissions.pm | 40 ++ C4/Schema/Result/Userflags.pm | 43 ++ C4/Schema/Result/Virtualshelfcontents.pm | 42 ++ C4/Schema/Result/Virtualshelves.pm | 57 +++ C4/Schema/Result/Z3950servers.pm | 100 +++++ C4/Schema/Result/Zebraqueue.pm | 37 ++ 117 files changed, 7686 insertions(+), 0 deletions(-) create mode 100644 C4/Schema/Result/Accountlines.pm create mode 100644 C4/Schema/Result/Accountoffsets.pm create mode 100644 C4/Schema/Result/ActionLogs.pm create mode 100644 C4/Schema/Result/Alert.pm create mode 100644 C4/Schema/Result/Aqbasket.pm create mode 100644 C4/Schema/Result/Aqbookfund.pm create mode 100644 C4/Schema/Result/Aqbooksellers.pm create mode 100644 C4/Schema/Result/Aqbudget.pm create mode 100644 C4/Schema/Result/Aqorderbreakdown.pm create mode 100644 C4/Schema/Result/Aqorderdelivery.pm create mode 100644 C4/Schema/Result/Aqorders.pm create mode 100644 C4/Schema/Result/AuthHeader.pm create mode 100644 C4/Schema/Result/AuthSubfieldStructure.pm create mode 100644 C4/Schema/Result/AuthTagStructure.pm create mode 100644 C4/Schema/Result/AuthTypes.pm create mode 100644 C4/Schema/Result/AuthorisedValues.pm create mode 100644 C4/Schema/Result/Biblio.pm create mode 100644 C4/Schema/Result/BiblioFramework.pm create mode 100644 C4/Schema/Result/Biblioitems.pm create mode 100644 C4/Schema/Result/BorrowerAttributeTypes.pm create mode 100644 C4/Schema/Result/BorrowerAttributes.pm create mode 100644 C4/Schema/Result/BorrowerMessagePreferences.pm create mode 100644 C4/Schema/Result/BorrowerMessageTransportPreferences.pm create mode 100644 C4/Schema/Result/Borrowers.pm create mode 100644 C4/Schema/Result/BranchBorrowerCircRules.pm create mode 100644 C4/Schema/Result/Branchcategories.pm create mode 100644 C4/Schema/Result/Branches.pm create mode 100644 C4/Schema/Result/Branchrelations.pm create mode 100644 C4/Schema/Result/Branchtransfers.pm create mode 100644 C4/Schema/Result/Browser.pm create mode 100644 C4/Schema/Result/Categories.pm create mode 100644 C4/Schema/Result/Cities.pm create mode 100644 C4/Schema/Result/ClassSortRules.pm create mode 100644 C4/Schema/Result/ClassSources.pm create mode 100644 C4/Schema/Result/Currency.pm create mode 100644 C4/Schema/Result/DefaultBorrowerCircRules.pm create mode 100644 C4/Schema/Result/DefaultBranchCircRules.pm create mode 100644 C4/Schema/Result/DefaultCircRules.pm create mode 100644 C4/Schema/Result/Deletedbiblio.pm create mode 100644 C4/Schema/Result/Deletedbiblioitems.pm create mode 100644 C4/Schema/Result/Deletedborrowers.pm create mode 100644 C4/Schema/Result/Deleteditems.pm create mode 100644 C4/Schema/Result/Ethnicity.pm create mode 100644 C4/Schema/Result/HoldFillTargets.pm create mode 100644 C4/Schema/Result/ImportBatches.pm create mode 100644 C4/Schema/Result/ImportBiblios.pm create mode 100644 C4/Schema/Result/ImportItems.pm create mode 100644 C4/Schema/Result/ImportRecordMatches.pm create mode 100644 C4/Schema/Result/ImportRecords.pm create mode 100644 C4/Schema/Result/Issues.pm create mode 100644 C4/Schema/Result/Issuingrules.pm create mode 100644 C4/Schema/Result/Items.pm create mode 100644 C4/Schema/Result/Itemtypes.pm create mode 100644 C4/Schema/Result/Labels.pm create mode 100644 C4/Schema/Result/LabelsConf.pm create mode 100644 C4/Schema/Result/LabelsProfile.pm create mode 100644 C4/Schema/Result/LabelsTemplates.pm create mode 100644 C4/Schema/Result/LanguageDescriptions.pm create mode 100644 C4/Schema/Result/LanguageRfc4646ToIso639.pm create mode 100644 C4/Schema/Result/LanguageScriptBidi.pm create mode 100644 C4/Schema/Result/LanguageScriptMapping.pm create mode 100644 C4/Schema/Result/LanguageSubtagRegistry.pm create mode 100644 C4/Schema/Result/Letter.pm create mode 100644 C4/Schema/Result/MarcMatchers.pm create mode 100644 C4/Schema/Result/MarcSubfieldStructure.pm create mode 100644 C4/Schema/Result/MarcTagStructure.pm create mode 100644 C4/Schema/Result/Matchchecks.pm create mode 100644 C4/Schema/Result/MatcherMatchpoints.pm create mode 100644 C4/Schema/Result/MatchpointComponentNorms.pm create mode 100644 C4/Schema/Result/MatchpointComponents.pm create mode 100644 C4/Schema/Result/Matchpoints.pm create mode 100644 C4/Schema/Result/MessageAttributes.pm create mode 100644 C4/Schema/Result/MessageQueue.pm create mode 100644 C4/Schema/Result/MessageTransportTypes.pm create mode 100644 C4/Schema/Result/MessageTransports.pm create mode 100644 C4/Schema/Result/Notifys.pm create mode 100644 C4/Schema/Result/Nozebra.pm create mode 100644 C4/Schema/Result/OldIssues.pm create mode 100644 C4/Schema/Result/OldReserves.pm create mode 100644 C4/Schema/Result/OpacNews.pm create mode 100644 C4/Schema/Result/Overduerules.pm create mode 100644 C4/Schema/Result/Patroncards.pm create mode 100644 C4/Schema/Result/Patronimage.pm create mode 100644 C4/Schema/Result/Permissions.pm create mode 100644 C4/Schema/Result/Printers.pm create mode 100644 C4/Schema/Result/PrintersProfile.pm create mode 100644 C4/Schema/Result/RepeatableHolidays.pm create mode 100644 C4/Schema/Result/ReportsDictionary.pm create mode 100644 C4/Schema/Result/Reserveconstraints.pm create mode 100644 C4/Schema/Result/Reserves.pm create mode 100644 C4/Schema/Result/Reviews.pm create mode 100644 C4/Schema/Result/Roadtype.pm create mode 100644 C4/Schema/Result/SavedReports.pm create mode 100644 C4/Schema/Result/SavedSql.pm create mode 100644 C4/Schema/Result/Serial.pm create mode 100644 C4/Schema/Result/Serialitems.pm create mode 100644 C4/Schema/Result/ServicesThrottle.pm create mode 100644 C4/Schema/Result/Sessions.pm create mode 100644 C4/Schema/Result/SpecialHolidays.pm create mode 100644 C4/Schema/Result/Statistics.pm create mode 100644 C4/Schema/Result/Stopwords.pm create mode 100644 C4/Schema/Result/Subscription.pm create mode 100644 C4/Schema/Result/Subscriptionhistory.pm create mode 100644 C4/Schema/Result/Subscriptionroutinglist.pm create mode 100644 C4/Schema/Result/Suggestions.pm create mode 100644 C4/Schema/Result/Systempreferences.pm create mode 100644 C4/Schema/Result/Tags.pm create mode 100644 C4/Schema/Result/TagsAll.pm create mode 100644 C4/Schema/Result/TagsApproval.pm create mode 100644 C4/Schema/Result/TagsIndex.pm create mode 100644 C4/Schema/Result/TmpHoldsqueue.pm create mode 100644 C4/Schema/Result/UserPermissions.pm create mode 100644 C4/Schema/Result/Userflags.pm create mode 100644 C4/Schema/Result/Virtualshelfcontents.pm create mode 100644 C4/Schema/Result/Virtualshelves.pm create mode 100644 C4/Schema/Result/Z3950servers.pm create mode 100644 C4/Schema/Result/Zebraqueue.pm diff --git a/C4/Schema/Result/Accountlines.pm b/C4/Schema/Result/Accountlines.pm new file mode 100644 index 0000000..4c5c057 --- /dev/null +++ b/C4/Schema/Result/Accountlines.pm @@ -0,0 +1,85 @@ +package C4::Schema::Result::Accountlines; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("accountlines"); +__PACKAGE__->add_columns( + "borrowernumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "accountno", + { data_type => "SMALLINT", default_value => 0, is_nullable => 0, size => 6 }, + "itemnumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "date", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "amount", + { + data_type => "DECIMAL", + default_value => undef, + is_nullable => 1, + size => 28, + }, + "description", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "dispute", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "accounttype", + { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 5 }, + "amountoutstanding", + { + data_type => "DECIMAL", + default_value => undef, + is_nullable => 1, + size => 28, + }, + "timestamp", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, + "notify_id", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "notify_level", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 2 }, + "lastincrement", + { + data_type => "DECIMAL", + default_value => undef, + is_nullable => 1, + size => 28, + }, +); +__PACKAGE__->belongs_to( + "borrowernumber", + "C4::Schema::Result::Borrowers", + { borrowernumber => "borrowernumber" }, +); +__PACKAGE__->belongs_to( + "itemnumber", + "C4::Schema::Result::Items", + { itemnumber => "itemnumber" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:u7NsYHstKgWp/3NPQ3PJWA + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Accountoffsets.pm b/C4/Schema/Result/Accountoffsets.pm new file mode 100644 index 0000000..87c50af --- /dev/null +++ b/C4/Schema/Result/Accountoffsets.pm @@ -0,0 +1,44 @@ +package C4::Schema::Result::Accountoffsets; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("accountoffsets"); +__PACKAGE__->add_columns( + "borrowernumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "accountno", + { data_type => "SMALLINT", default_value => 0, is_nullable => 0, size => 6 }, + "offsetaccount", + { data_type => "SMALLINT", default_value => 0, is_nullable => 0, size => 6 }, + "offsetamount", + { + data_type => "DECIMAL", + default_value => undef, + is_nullable => 1, + size => 28, + }, + "timestamp", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, +); +__PACKAGE__->belongs_to( + "borrowernumber", + "C4::Schema::Result::Borrowers", + { borrowernumber => "borrowernumber" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1dG5NOu2aFiiV5qVZ8ju+A + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/ActionLogs.pm b/C4/Schema/Result/ActionLogs.pm new file mode 100644 index 0000000..424652c --- /dev/null +++ b/C4/Schema/Result/ActionLogs.pm @@ -0,0 +1,54 @@ +package C4::Schema::Result::ActionLogs; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("action_logs"); +__PACKAGE__->add_columns( + "action_id", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "timestamp", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, + "user", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "module", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "action", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "object", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "info", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, +); +__PACKAGE__->set_primary_key("action_id"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:55PZYYguwgNVzyaeKm3Ukg + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Alert.pm b/C4/Schema/Result/Alert.pm new file mode 100644 index 0000000..1c6adf2 --- /dev/null +++ b/C4/Schema/Result/Alert.pm @@ -0,0 +1,28 @@ +package C4::Schema::Result::Alert; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("alert"); +__PACKAGE__->add_columns( + "alertid", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "borrowernumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "type", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "externalid", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 20 }, +); +__PACKAGE__->set_primary_key("alertid"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3N8tLbTebKSbNq0QcuG9WQ + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Aqbasket.pm b/C4/Schema/Result/Aqbasket.pm new file mode 100644 index 0000000..3df58a1 --- /dev/null +++ b/C4/Schema/Result/Aqbasket.pm @@ -0,0 +1,52 @@ +package C4::Schema::Result::Aqbasket; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("aqbasket"); +__PACKAGE__->add_columns( + "basketno", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "creationdate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "closedate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "booksellerid", + { data_type => "INT", default_value => 1, is_nullable => 0, size => 11 }, + "authorisedby", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "booksellerinvoicenumber", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, +); +__PACKAGE__->set_primary_key("basketno"); +__PACKAGE__->belongs_to( + "booksellerid", + "C4::Schema::Result::Aqbooksellers", + { id => "booksellerid" }, +); +__PACKAGE__->has_many( + "aqorders", + "C4::Schema::Result::Aqorders", + { "foreign.basketno" => "self.basketno" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sVcAmPHi2VHPlbLlBtB+7w + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Aqbookfund.pm b/C4/Schema/Result/Aqbookfund.pm new file mode 100644 index 0000000..5234876 --- /dev/null +++ b/C4/Schema/Result/Aqbookfund.pm @@ -0,0 +1,38 @@ +package C4::Schema::Result::Aqbookfund; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("aqbookfund"); +__PACKAGE__->add_columns( + "bookfundid", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "bookfundname", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "bookfundgroup", + { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 5 }, + "branchcode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, +); +__PACKAGE__->set_primary_key("bookfundid", "branchcode"); +__PACKAGE__->has_many( + "aqorderbreakdowns", + "C4::Schema::Result::Aqorderbreakdown", + { "foreign.bookfundid" => "self.bookfundid" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:W/imyCXbLCoqJeP9fgnXiA + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Aqbooksellers.pm b/C4/Schema/Result/Aqbooksellers.pm new file mode 100644 index 0000000..6440437 --- /dev/null +++ b/C4/Schema/Result/Aqbooksellers.pm @@ -0,0 +1,249 @@ +package C4::Schema::Result::Aqbooksellers; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("aqbooksellers"); +__PACKAGE__->add_columns( + "id", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "name", + { + data_type => "MEDIUMTEXT", + default_value => "", + is_nullable => 0, + size => 16777215, + }, + "address1", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "address2", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "address3", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "address4", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "phone", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 30, + }, + "accountnumber", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "othersupplier", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "currency", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 3 }, + "deliverydays", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "followupdays", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "followupscancel", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "specialty", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "booksellerfax", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "notes", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "bookselleremail", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "booksellerurl", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "contact", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 100, + }, + "postal", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "url", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "contpos", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 100, + }, + "contphone", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 100, + }, + "contfax", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 100, + }, + "contaltphone", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 100, + }, + "contemail", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 100, + }, + "contnotes", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "active", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 4 }, + "listprice", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "invoiceprice", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "gstreg", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 4 }, + "listincgst", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 4 }, + "invoiceincgst", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 4 }, + "discount", + { data_type => "FLOAT", default_value => undef, is_nullable => 1, size => 32 }, + "fax", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 50, + }, + "nocalc", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "invoicedisc", + { data_type => "FLOAT", default_value => undef, is_nullable => 1, size => 32 }, +); +__PACKAGE__->set_primary_key("id"); +__PACKAGE__->has_many( + "aqbaskets", + "C4::Schema::Result::Aqbasket", + { "foreign.booksellerid" => "self.id" }, +); +__PACKAGE__->belongs_to( + "listprice", + "C4::Schema::Result::Currency", + { currency => "listprice" }, +); +__PACKAGE__->belongs_to( + "invoiceprice", + "C4::Schema::Result::Currency", + { currency => "invoiceprice" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qZp8P4q3dHK0oXsN/Z05MA + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Aqbudget.pm b/C4/Schema/Result/Aqbudget.pm new file mode 100644 index 0000000..02f8c9d --- /dev/null +++ b/C4/Schema/Result/Aqbudget.pm @@ -0,0 +1,47 @@ +package C4::Schema::Result::Aqbudget; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("aqbudget"); +__PACKAGE__->add_columns( + "bookfundid", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "startdate", + { + data_type => "DATE", + default_value => "0000-00-00", + is_nullable => 0, + size => 10, + }, + "enddate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "budgetamount", + { + data_type => "DECIMAL", + default_value => undef, + is_nullable => 1, + size => 13, + }, + "aqbudgetid", + { data_type => "TINYINT", default_value => undef, is_nullable => 0, size => 4 }, + "branchcode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, +); +__PACKAGE__->set_primary_key("aqbudgetid"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:aRBVi2ZV3DCQJdKayefySw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Aqorderbreakdown.pm b/C4/Schema/Result/Aqorderbreakdown.pm new file mode 100644 index 0000000..8220549 --- /dev/null +++ b/C4/Schema/Result/Aqorderbreakdown.pm @@ -0,0 +1,49 @@ +package C4::Schema::Result::Aqorderbreakdown; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("aqorderbreakdown"); +__PACKAGE__->add_columns( + "ordernumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "linenumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "branchcode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "bookfundid", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "allocation", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, +); +__PACKAGE__->belongs_to( + "ordernumber", + "C4::Schema::Result::Aqorders", + { ordernumber => "ordernumber" }, +); +__PACKAGE__->belongs_to( + "bookfundid", + "C4::Schema::Result::Aqbookfund", + { bookfundid => "bookfundid" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wmP41X15pNNLWONvDwec9w + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Aqorderdelivery.pm b/C4/Schema/Result/Aqorderdelivery.pm new file mode 100644 index 0000000..aa55c8c --- /dev/null +++ b/C4/Schema/Result/Aqorderdelivery.pm @@ -0,0 +1,44 @@ +package C4::Schema::Result::Aqorderdelivery; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("aqorderdelivery"); +__PACKAGE__->add_columns( + "ordernumber", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "deliverynumber", + { data_type => "SMALLINT", default_value => 0, is_nullable => 0, size => 6 }, + "deliverydate", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 18, + }, + "qtydelivered", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "deliverycomments", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oWRXWBp7JDy2y15QUD8R6Q + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Aqorders.pm b/C4/Schema/Result/Aqorders.pm new file mode 100644 index 0000000..2deb88c --- /dev/null +++ b/C4/Schema/Result/Aqorders.pm @@ -0,0 +1,188 @@ +package C4::Schema::Result::Aqorders; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("aqorders"); +__PACKAGE__->add_columns( + "ordernumber", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "biblionumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "title", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "entrydate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "quantity", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "currency", + { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 3 }, + "listprice", + { + data_type => "DECIMAL", + default_value => undef, + is_nullable => 1, + size => 28, + }, + "totalamount", + { + data_type => "DECIMAL", + default_value => undef, + is_nullable => 1, + size => 28, + }, + "datereceived", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "booksellerinvoicenumber", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "freight", + { + data_type => "DECIMAL", + default_value => undef, + is_nullable => 1, + size => 28, + }, + "unitprice", + { + data_type => "DECIMAL", + default_value => undef, + is_nullable => 1, + size => 28, + }, + "quantityreceived", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "cancelledby", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "datecancellationprinted", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "notes", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "supplierreference", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "purchaseordernumber", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "subscription", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 1 }, + "serialid", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 30, + }, + "basketno", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "biblioitemnumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "timestamp", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, + "rrp", + { + data_type => "DECIMAL", + default_value => undef, + is_nullable => 1, + size => 13, + }, + "ecost", + { + data_type => "DECIMAL", + default_value => undef, + is_nullable => 1, + size => 13, + }, + "gst", + { + data_type => "DECIMAL", + default_value => undef, + is_nullable => 1, + size => 13, + }, + "budgetdate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "sort1", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 80, + }, + "sort2", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 80, + }, +); +__PACKAGE__->set_primary_key("ordernumber"); +__PACKAGE__->has_many( + "aqorderbreakdowns", + "C4::Schema::Result::Aqorderbreakdown", + { "foreign.ordernumber" => "self.ordernumber" }, +); +__PACKAGE__->belongs_to( + "basketno", + "C4::Schema::Result::Aqbasket", + { basketno => "basketno" }, +); +__PACKAGE__->belongs_to( + "biblionumber", + "C4::Schema::Result::Biblio", + { biblionumber => "biblionumber" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7EufYZLkTiJCJt2xM5peLg + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/AuthHeader.pm b/C4/Schema/Result/AuthHeader.pm new file mode 100644 index 0000000..b384879 --- /dev/null +++ b/C4/Schema/Result/AuthHeader.pm @@ -0,0 +1,58 @@ +package C4::Schema::Result::AuthHeader; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("auth_header"); +__PACKAGE__->add_columns( + "authid", + { data_type => "BIGINT", default_value => undef, is_nullable => 0, size => 20 }, + "authtypecode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "datecreated", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "datemodified", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "origincode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 20, + }, + "authtrees", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "marc", + { + data_type => "BLOB", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "linkid", + { data_type => "BIGINT", default_value => undef, is_nullable => 1, size => 20 }, + "marcxml", + { + data_type => "LONGTEXT", + default_value => "", + is_nullable => 0, + size => 4294967295, + }, +); +__PACKAGE__->set_primary_key("authid"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jNZqAdQVZq/oX5oKqmbSAg + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/AuthSubfieldStructure.pm b/C4/Schema/Result/AuthSubfieldStructure.pm new file mode 100644 index 0000000..4e2bf03 --- /dev/null +++ b/C4/Schema/Result/AuthSubfieldStructure.pm @@ -0,0 +1,67 @@ +package C4::Schema::Result::AuthSubfieldStructure; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("auth_subfield_structure"); +__PACKAGE__->add_columns( + "authtypecode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "tagfield", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 3 }, + "tagsubfield", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 1 }, + "liblibrarian", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 255 }, + "libopac", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 255 }, + "repeatable", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 4 }, + "mandatory", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 4 }, + "tab", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 1 }, + "authorised_value", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "value_builder", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 80, + }, + "seealso", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "isurl", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 1 }, + "hidden", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 3 }, + "linkid", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 }, + "kohafield", + { data_type => "VARCHAR", default_value => "", is_nullable => 1, size => 45 }, + "frameworkcode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 8 }, +); +__PACKAGE__->set_primary_key("authtypecode", "tagfield", "tagsubfield"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Dacs/V9bpMkF9Kb6payE6g + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/AuthTagStructure.pm b/C4/Schema/Result/AuthTagStructure.pm new file mode 100644 index 0000000..e506f9d --- /dev/null +++ b/C4/Schema/Result/AuthTagStructure.pm @@ -0,0 +1,44 @@ +package C4::Schema::Result::AuthTagStructure; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("auth_tag_structure"); +__PACKAGE__->add_columns( + "authtypecode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "tagfield", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 3 }, + "liblibrarian", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 255 }, + "libopac", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 255 }, + "repeatable", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 4 }, + "mandatory", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 4 }, + "authorised_value", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, +); +__PACKAGE__->set_primary_key("authtypecode", "tagfield"); +__PACKAGE__->belongs_to( + "authtypecode", + "C4::Schema::Result::AuthTypes", + { authtypecode => "authtypecode" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:w+bsNqidvBsRF6Vy0rtocQ + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/AuthTypes.pm b/C4/Schema/Result/AuthTypes.pm new file mode 100644 index 0000000..2521b77 --- /dev/null +++ b/C4/Schema/Result/AuthTypes.pm @@ -0,0 +1,38 @@ +package C4::Schema::Result::AuthTypes; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("auth_types"); +__PACKAGE__->add_columns( + "authtypecode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "authtypetext", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 255 }, + "auth_tag_to_report", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 3 }, + "summary", + { + data_type => "MEDIUMTEXT", + default_value => "", + is_nullable => 0, + size => 16777215, + }, +); +__PACKAGE__->set_primary_key("authtypecode"); +__PACKAGE__->has_many( + "auth_tag_structures", + "C4::Schema::Result::AuthTagStructure", + { "foreign.authtypecode" => "self.authtypecode" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fl/afGAeMEyxUQPZPkodJg + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/AuthorisedValues.pm b/C4/Schema/Result/AuthorisedValues.pm new file mode 100644 index 0000000..4b7c014 --- /dev/null +++ b/C4/Schema/Result/AuthorisedValues.pm @@ -0,0 +1,40 @@ +package C4::Schema::Result::AuthorisedValues; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("authorised_values"); +__PACKAGE__->add_columns( + "id", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "category", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "authorised_value", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 80 }, + "lib", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 80, + }, + "imageurl", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 200, + }, +); +__PACKAGE__->set_primary_key("id"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9vOSO1MOR7ajkhd1YIHdnQ + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Biblio.pm b/C4/Schema/Result/Biblio.pm new file mode 100644 index 0000000..156c2c2 --- /dev/null +++ b/C4/Schema/Result/Biblio.pm @@ -0,0 +1,124 @@ +package C4::Schema::Result::Biblio; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("biblio"); +__PACKAGE__->add_columns( + "biblionumber", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "frameworkcode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 4 }, + "author", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "title", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "unititle", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "notes", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "serial", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 1 }, + "seriestitle", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "copyrightdate", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "timestamp", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, + "datecreated", + { data_type => "DATE", default_value => "", is_nullable => 0, size => 10 }, + "abstract", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, +); +__PACKAGE__->set_primary_key("biblionumber"); +__PACKAGE__->has_many( + "aqorders", + "C4::Schema::Result::Aqorders", + { "foreign.biblionumber" => "self.biblionumber" }, +); +__PACKAGE__->has_many( + "biblioitems", + "C4::Schema::Result::Biblioitems", + { "foreign.biblionumber" => "self.biblionumber" }, +); +__PACKAGE__->has_many( + "hold_fill_targets", + "C4::Schema::Result::HoldFillTargets", + { "foreign.biblionumber" => "self.biblionumber" }, +); +__PACKAGE__->has_many( + "old_reserves", + "C4::Schema::Result::OldReserves", + { "foreign.biblionumber" => "self.biblionumber" }, +); +__PACKAGE__->has_many( + "reserves", + "C4::Schema::Result::Reserves", + { "foreign.biblionumber" => "self.biblionumber" }, +); +__PACKAGE__->has_many( + "tags_alls", + "C4::Schema::Result::TagsAll", + { "foreign.biblionumber" => "self.biblionumber" }, +); +__PACKAGE__->has_many( + "tags_indexes", + "C4::Schema::Result::TagsIndex", + { "foreign.biblionumber" => "self.biblionumber" }, +); +__PACKAGE__->has_many( + "virtualshelfcontents", + "C4::Schema::Result::Virtualshelfcontents", + { "foreign.biblionumber" => "self.biblionumber" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YefOFtlJJwijex79zI70sw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/BiblioFramework.pm b/C4/Schema/Result/BiblioFramework.pm new file mode 100644 index 0000000..cb8035f --- /dev/null +++ b/C4/Schema/Result/BiblioFramework.pm @@ -0,0 +1,24 @@ +package C4::Schema::Result::BiblioFramework; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("biblio_framework"); +__PACKAGE__->add_columns( + "frameworkcode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 4 }, + "frameworktext", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 255 }, +); +__PACKAGE__->set_primary_key("frameworkcode"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZSnTDnbTqH+QERw167cfLg + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Biblioitems.pm b/C4/Schema/Result/Biblioitems.pm new file mode 100644 index 0000000..542c68b --- /dev/null +++ b/C4/Schema/Result/Biblioitems.pm @@ -0,0 +1,229 @@ +package C4::Schema::Result::Biblioitems; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("biblioitems"); +__PACKAGE__->add_columns( + "biblioitemnumber", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "biblionumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "volume", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "number", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "itemtype", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "isbn", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 14, + }, + "issn", + { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 9 }, + "publicationyear", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "publishercode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "volumedate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "volumedesc", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "collectiontitle", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "collectionissn", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "collectionvolume", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "editionstatement", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "editionresponsibility", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "timestamp", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, + "illus", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "pages", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "notes", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "size", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "place", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "lccn", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 25, + }, + "marc", + { + data_type => "LONGBLOB", + default_value => undef, + is_nullable => 1, + size => 4294967295, + }, + "url", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "cn_source", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "cn_class", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 30, + }, + "cn_item", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "cn_suffix", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "cn_sort", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 30, + }, + "totalissues", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 10 }, + "marcxml", + { + data_type => "LONGTEXT", + default_value => "", + is_nullable => 0, + size => 4294967295, + }, +); +__PACKAGE__->set_primary_key("biblioitemnumber"); +__PACKAGE__->belongs_to( + "biblionumber", + "C4::Schema::Result::Biblio", + { biblionumber => "biblionumber" }, +); +__PACKAGE__->has_many( + "items", + "C4::Schema::Result::Items", + { "foreign.biblioitemnumber" => "self.biblioitemnumber" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gIzYbpAqwzsQsAxPpAI7Sw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/BorrowerAttributeTypes.pm b/C4/Schema/Result/BorrowerAttributeTypes.pm new file mode 100644 index 0000000..a56e12c --- /dev/null +++ b/C4/Schema/Result/BorrowerAttributeTypes.pm @@ -0,0 +1,46 @@ +package C4::Schema::Result::BorrowerAttributeTypes; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("borrower_attribute_types"); +__PACKAGE__->add_columns( + "code", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "description", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 255 }, + "repeatable", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 }, + "unique_id", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 }, + "opac_display", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 }, + "password_allowed", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 }, + "staff_searchable", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 }, + "authorised_value_category", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, +); +__PACKAGE__->set_primary_key("code"); +__PACKAGE__->has_many( + "borrower_attributes", + "C4::Schema::Result::BorrowerAttributes", + { "foreign.code" => "self.code" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:npbFOShTGeGdyMOt0ac/gQ + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/BorrowerAttributes.pm b/C4/Schema/Result/BorrowerAttributes.pm new file mode 100644 index 0000000..ebf90c3 --- /dev/null +++ b/C4/Schema/Result/BorrowerAttributes.pm @@ -0,0 +1,47 @@ +package C4::Schema::Result::BorrowerAttributes; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("borrower_attributes"); +__PACKAGE__->add_columns( + "borrowernumber", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, + "code", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "attribute", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 30, + }, + "password", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 30, + }, +); +__PACKAGE__->belongs_to( + "borrowernumber", + "C4::Schema::Result::Borrowers", + { borrowernumber => "borrowernumber" }, +); +__PACKAGE__->belongs_to( + "code", + "C4::Schema::Result::BorrowerAttributeTypes", + { code => "code" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RuApKFGygg4eL98zSPSZ6Q + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/BorrowerMessagePreferences.pm b/C4/Schema/Result/BorrowerMessagePreferences.pm new file mode 100644 index 0000000..353d63d --- /dev/null +++ b/C4/Schema/Result/BorrowerMessagePreferences.pm @@ -0,0 +1,47 @@ +package C4::Schema::Result::BorrowerMessagePreferences; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("borrower_message_preferences"); +__PACKAGE__->add_columns( + "borrower_message_preference_id", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "borrowernumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "message_attribute_id", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 11 }, + "days_in_advance", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 11 }, + "wants_digest", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 }, +); +__PACKAGE__->set_primary_key("borrower_message_preference_id"); +__PACKAGE__->belongs_to( + "borrowernumber", + "C4::Schema::Result::Borrowers", + { borrowernumber => "borrowernumber" }, +); +__PACKAGE__->belongs_to( + "message_attribute_id", + "C4::Schema::Result::MessageAttributes", + { message_attribute_id => "message_attribute_id" }, +); +__PACKAGE__->has_many( + "borrower_message_transport_preferences", + "C4::Schema::Result::BorrowerMessageTransportPreferences", + { + "foreign.borrower_message_preference_id" => "self.borrower_message_preference_id", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+QJQ5w6s8qF1hWGurhz5Wg + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/BorrowerMessageTransportPreferences.pm b/C4/Schema/Result/BorrowerMessageTransportPreferences.pm new file mode 100644 index 0000000..e052b39 --- /dev/null +++ b/C4/Schema/Result/BorrowerMessageTransportPreferences.pm @@ -0,0 +1,36 @@ +package C4::Schema::Result::BorrowerMessageTransportPreferences; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("borrower_message_transport_preferences"); +__PACKAGE__->add_columns( + "borrower_message_preference_id", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "message_transport_type", + { data_type => "VARCHAR", default_value => 0, is_nullable => 0, size => 20 }, +); +__PACKAGE__->set_primary_key("borrower_message_preference_id", "message_transport_type"); +__PACKAGE__->belongs_to( + "borrower_message_preference_id", + "C4::Schema::Result::BorrowerMessagePreferences", + { + "borrower_message_preference_id" => "borrower_message_preference_id", + }, +); +__PACKAGE__->belongs_to( + "message_transport_type", + "C4::Schema::Result::MessageTransportTypes", + { "message_transport_type" => "message_transport_type" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xViQo107In7920TUIE9k2A + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Borrowers.pm b/C4/Schema/Result/Borrowers.pm new file mode 100644 index 0000000..bd75341 --- /dev/null +++ b/C4/Schema/Result/Borrowers.pm @@ -0,0 +1,452 @@ +package C4::Schema::Result::Borrowers; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("borrowers"); +__PACKAGE__->add_columns( + "borrowernumber", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "cardnumber", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 16, + }, + "surname", + { + data_type => "MEDIUMTEXT", + default_value => "", + is_nullable => 0, + size => 16777215, + }, + "firstname", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "title", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "othernames", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "initials", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "streetnumber", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "streettype", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 50, + }, + "address", + { + data_type => "MEDIUMTEXT", + default_value => "", + is_nullable => 0, + size => 16777215, + }, + "address2", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "city", + { + data_type => "MEDIUMTEXT", + default_value => "", + is_nullable => 0, + size => 16777215, + }, + "zipcode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 25, + }, + "email", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "phone", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "mobile", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 50, + }, + "fax", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "emailpro", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "phonepro", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "b_streetnumber", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "b_streettype", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 50, + }, + "b_address", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 100, + }, + "b_city", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "b_zipcode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 25, + }, + "b_email", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "b_phone", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "dateofbirth", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "branchcode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "categorycode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "dateenrolled", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "dateexpiry", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "gonenoaddress", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 1 }, + "lost", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 1 }, + "debarred", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 1 }, + "contactname", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "contactfirstname", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "contacttitle", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "guarantorid", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "borrowernotes", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "relationship", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 100, + }, + "ethnicity", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 50, + }, + "ethnotes", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "sex", + { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 1 }, + "password", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 30, + }, + "flags", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "userid", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 30, + }, + "opacnote", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "contactnote", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "sort1", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 80, + }, + "sort2", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 80, + }, + "altcontactfirstname", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "altcontactsurname", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "altcontactaddress1", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "altcontactaddress2", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "altcontactaddress3", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "altcontactzipcode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 50, + }, + "altcontactphone", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 50, + }, + "smsalertnumber", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 50, + }, +); +__PACKAGE__->set_primary_key("borrowernumber"); +__PACKAGE__->add_unique_constraint("cardnumber", ["cardnumber"]); +__PACKAGE__->has_many( + "accountlines", + "C4::Schema::Result::Accountlines", + { "foreign.borrowernumber" => "self.borrowernumber" }, +); +__PACKAGE__->has_many( + "accountoffsets", + "C4::Schema::Result::Accountoffsets", + { "foreign.borrowernumber" => "self.borrowernumber" }, +); +__PACKAGE__->has_many( + "borrower_attributes", + "C4::Schema::Result::BorrowerAttributes", + { "foreign.borrowernumber" => "self.borrowernumber" }, +); +__PACKAGE__->has_many( + "borrower_message_preferences", + "C4::Schema::Result::BorrowerMessagePreferences", + { "foreign.borrowernumber" => "self.borrowernumber" }, +); +__PACKAGE__->belongs_to( + "categorycode", + "C4::Schema::Result::Categories", + { categorycode => "categorycode" }, +); +__PACKAGE__->belongs_to( + "branchcode", + "C4::Schema::Result::Branches", + { branchcode => "branchcode" }, +); +__PACKAGE__->has_many( + "hold_fill_targets", + "C4::Schema::Result::HoldFillTargets", + { "foreign.borrowernumber" => "self.borrowernumber" }, +); +__PACKAGE__->has_many( + "issues", + "C4::Schema::Result::Issues", + { "foreign.borrowernumber" => "self.borrowernumber" }, +); +__PACKAGE__->has_many( + "message_queues", + "C4::Schema::Result::MessageQueue", + { "foreign.borrowernumber" => "self.borrowernumber" }, +); +__PACKAGE__->has_many( + "old_issues", + "C4::Schema::Result::OldIssues", + { "foreign.borrowernumber" => "self.borrowernumber" }, +); +__PACKAGE__->has_many( + "old_reserves", + "C4::Schema::Result::OldReserves", + { "foreign.borrowernumber" => "self.borrowernumber" }, +); +__PACKAGE__->has_many( + "patroncards", + "C4::Schema::Result::Patroncards", + { "foreign.borrowernumber" => "self.borrowernumber" }, +); +__PACKAGE__->has_many( + "patronimages", + "C4::Schema::Result::Patronimage", + { "foreign.cardnumber" => "self.cardnumber" }, +); +__PACKAGE__->has_many( + "reserves", + "C4::Schema::Result::Reserves", + { "foreign.borrowernumber" => "self.borrowernumber" }, +); +__PACKAGE__->has_many( + "tags_alls", + "C4::Schema::Result::TagsAll", + { "foreign.borrowernumber" => "self.borrowernumber" }, +); +__PACKAGE__->has_many( + "tags_approvals", + "C4::Schema::Result::TagsApproval", + { "foreign.approved_by" => "self.borrowernumber" }, +); +__PACKAGE__->has_many( + "user_permissions", + "C4::Schema::Result::UserPermissions", + { "foreign.borrowernumber" => "self.borrowernumber" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2VheU5/3oKGjfGLqLqoGlQ + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/BranchBorrowerCircRules.pm b/C4/Schema/Result/BranchBorrowerCircRules.pm new file mode 100644 index 0000000..dcb2235 --- /dev/null +++ b/C4/Schema/Result/BranchBorrowerCircRules.pm @@ -0,0 +1,36 @@ +package C4::Schema::Result::BranchBorrowerCircRules; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("branch_borrower_circ_rules"); +__PACKAGE__->add_columns( + "branchcode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "categorycode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "maxissueqty", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 4 }, +); +__PACKAGE__->set_primary_key("categorycode", "branchcode"); +__PACKAGE__->belongs_to( + "categorycode", + "C4::Schema::Result::Categories", + { categorycode => "categorycode" }, +); +__PACKAGE__->belongs_to( + "branchcode", + "C4::Schema::Result::Branches", + { branchcode => "branchcode" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5/jDTplEb1CEWmTFylL4Qw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Branchcategories.pm b/C4/Schema/Result/Branchcategories.pm new file mode 100644 index 0000000..a05bea1 --- /dev/null +++ b/C4/Schema/Result/Branchcategories.pm @@ -0,0 +1,48 @@ +package C4::Schema::Result::Branchcategories; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("branchcategories"); +__PACKAGE__->add_columns( + "categorycode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "categoryname", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 32, + }, + "codedescription", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "categorytype", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 16, + }, +); +__PACKAGE__->set_primary_key("categorycode"); +__PACKAGE__->has_many( + "branchrelations", + "C4::Schema::Result::Branchrelations", + { "foreign.categorycode" => "self.categorycode" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hnWkHBuG4VeQKnXtA0PrwQ + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Branches.pm b/C4/Schema/Result/Branches.pm new file mode 100644 index 0000000..61ba8b7 --- /dev/null +++ b/C4/Schema/Result/Branches.pm @@ -0,0 +1,137 @@ +package C4::Schema::Result::Branches; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("branches"); +__PACKAGE__->add_columns( + "branchcode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "branchname", + { + data_type => "MEDIUMTEXT", + default_value => "", + is_nullable => 0, + size => 16777215, + }, + "branchaddress1", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "branchaddress2", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "branchaddress3", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "branchphone", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "branchfax", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "branchemail", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "issuing", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 4 }, + "branchip", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 15, + }, + "branchprinter", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 100, + }, +); +__PACKAGE__->add_unique_constraint("branchcode", ["branchcode"]); +__PACKAGE__->has_many( + "borrowers", + "C4::Schema::Result::Borrowers", + { "foreign.branchcode" => "self.branchcode" }, +); +__PACKAGE__->has_many( + "branch_borrower_circ_rules", + "C4::Schema::Result::BranchBorrowerCircRules", + { "foreign.branchcode" => "self.branchcode" }, +); +__PACKAGE__->has_many( + "branchrelations", + "C4::Schema::Result::Branchrelations", + { "foreign.branchcode" => "self.branchcode" }, +); +__PACKAGE__->has_many( + "branchtransfers_frombranches", + "C4::Schema::Result::Branchtransfers", + { "foreign.frombranch" => "self.branchcode" }, +); +__PACKAGE__->has_many( + "branchtransfers_tobranches", + "C4::Schema::Result::Branchtransfers", + { "foreign.tobranch" => "self.branchcode" }, +); +__PACKAGE__->has_many( + "default_branch_circ_rules", + "C4::Schema::Result::DefaultBranchCircRules", + { "foreign.branchcode" => "self.branchcode" }, +); +__PACKAGE__->has_many( + "hold_fill_targets", + "C4::Schema::Result::HoldFillTargets", + { "foreign.source_branchcode" => "self.branchcode" }, +); +__PACKAGE__->has_many( + "items_homebranches", + "C4::Schema::Result::Items", + { "foreign.homebranch" => "self.branchcode" }, +); +__PACKAGE__->has_many( + "items_holdingbranches", + "C4::Schema::Result::Items", + { "foreign.holdingbranch" => "self.branchcode" }, +); +__PACKAGE__->has_many( + "reserves", + "C4::Schema::Result::Reserves", + { "foreign.branchcode" => "self.branchcode" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7vx5lVZdIdJaGBDC0Lpt6A + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Branchrelations.pm b/C4/Schema/Result/Branchrelations.pm new file mode 100644 index 0000000..3c43dba --- /dev/null +++ b/C4/Schema/Result/Branchrelations.pm @@ -0,0 +1,34 @@ +package C4::Schema::Result::Branchrelations; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("branchrelations"); +__PACKAGE__->add_columns( + "branchcode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "categorycode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, +); +__PACKAGE__->set_primary_key("branchcode", "categorycode"); +__PACKAGE__->belongs_to( + "branchcode", + "C4::Schema::Result::Branches", + { branchcode => "branchcode" }, +); +__PACKAGE__->belongs_to( + "categorycode", + "C4::Schema::Result::Branchcategories", + { categorycode => "categorycode" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:XkpRwwST5jy6FCBvsB1fnw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Branchtransfers.pm b/C4/Schema/Result/Branchtransfers.pm new file mode 100644 index 0000000..a05ff7a --- /dev/null +++ b/C4/Schema/Result/Branchtransfers.pm @@ -0,0 +1,61 @@ +package C4::Schema::Result::Branchtransfers; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("branchtransfers"); +__PACKAGE__->add_columns( + "itemnumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "datesent", + { + data_type => "DATETIME", + default_value => undef, + is_nullable => 1, + size => 19, + }, + "frombranch", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "datearrived", + { + data_type => "DATETIME", + default_value => undef, + is_nullable => 1, + size => 19, + }, + "tobranch", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "comments", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, +); +__PACKAGE__->belongs_to( + "frombranch", + "C4::Schema::Result::Branches", + { branchcode => "frombranch" }, +); +__PACKAGE__->belongs_to( + "tobranch", + "C4::Schema::Result::Branches", + { branchcode => "tobranch" }, +); +__PACKAGE__->belongs_to( + "itemnumber", + "C4::Schema::Result::Items", + { itemnumber => "itemnumber" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Spl8S9Uwke7QHqV9M0uArw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Browser.pm b/C4/Schema/Result/Browser.pm new file mode 100644 index 0000000..6448cbb --- /dev/null +++ b/C4/Schema/Result/Browser.pm @@ -0,0 +1,29 @@ +package C4::Schema::Result::Browser; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("browser"); +__PACKAGE__->add_columns( + "level", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, + "classification", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 20 }, + "description", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 255 }, + "number", + { data_type => "BIGINT", default_value => "", is_nullable => 0, size => 20 }, + "endnode", + { data_type => "TINYINT", default_value => "", is_nullable => 0, size => 4 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:m+yhLFdsKnfkdltW22HvGQ + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Categories.pm b/C4/Schema/Result/Categories.pm new file mode 100644 index 0000000..758256a --- /dev/null +++ b/C4/Schema/Result/Categories.pm @@ -0,0 +1,95 @@ +package C4::Schema::Result::Categories; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("categories"); +__PACKAGE__->add_columns( + "categorycode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "description", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "enrolmentperiod", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "upperagelimit", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "dateofbirthrequired", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 1 }, + "finetype", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 30, + }, + "bulk", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 1 }, + "enrolmentfee", + { + data_type => "DECIMAL", + default_value => undef, + is_nullable => 1, + size => 28, + }, + "overduenoticerequired", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 1 }, + "issuelimit", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "reservefee", + { + data_type => "DECIMAL", + default_value => undef, + is_nullable => 1, + size => 28, + }, + "category_type", + { data_type => "VARCHAR", default_value => "A", is_nullable => 0, size => 1 }, +); +__PACKAGE__->set_primary_key("categorycode"); +__PACKAGE__->add_unique_constraint("categorycode", ["categorycode"]); +__PACKAGE__->has_many( + "borrowers", + "C4::Schema::Result::Borrowers", + { "foreign.categorycode" => "self.categorycode" }, +); +__PACKAGE__->has_many( + "branch_borrower_circ_rules", + "C4::Schema::Result::BranchBorrowerCircRules", + { "foreign.categorycode" => "self.categorycode" }, +); +__PACKAGE__->has_many( + "default_borrower_circ_rules", + "C4::Schema::Result::DefaultBorrowerCircRules", + { "foreign.categorycode" => "self.categorycode" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FPIcJGZUg+g6WeCBhXYTwA + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Cities.pm b/C4/Schema/Result/Cities.pm new file mode 100644 index 0000000..af088b0 --- /dev/null +++ b/C4/Schema/Result/Cities.pm @@ -0,0 +1,31 @@ +package C4::Schema::Result::Cities; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("cities"); +__PACKAGE__->add_columns( + "cityid", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "city_name", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 100 }, + "city_zipcode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 20, + }, +); +__PACKAGE__->set_primary_key("cityid"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hSaTo77ATxZ3gMZZ4ywP/A + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/ClassSortRules.pm b/C4/Schema/Result/ClassSortRules.pm new file mode 100644 index 0000000..67519d3 --- /dev/null +++ b/C4/Schema/Result/ClassSortRules.pm @@ -0,0 +1,37 @@ +package C4::Schema::Result::ClassSortRules; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("class_sort_rules"); +__PACKAGE__->add_columns( + "class_sort_rule", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "description", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "sort_routine", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 30 }, +); +__PACKAGE__->set_primary_key("class_sort_rule"); +__PACKAGE__->add_unique_constraint("class_sort_rule_idx", ["class_sort_rule"]); +__PACKAGE__->has_many( + "class_sources", + "C4::Schema::Result::ClassSources", + { "foreign.class_sort_rule" => "self.class_sort_rule" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kj09CoraMlZluFpSohGhcg + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/ClassSources.pm b/C4/Schema/Result/ClassSources.pm new file mode 100644 index 0000000..f5a25de --- /dev/null +++ b/C4/Schema/Result/ClassSources.pm @@ -0,0 +1,39 @@ +package C4::Schema::Result::ClassSources; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("class_sources"); +__PACKAGE__->add_columns( + "cn_source", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "description", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "used", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 4 }, + "class_sort_rule", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, +); +__PACKAGE__->set_primary_key("cn_source"); +__PACKAGE__->add_unique_constraint("cn_source_idx", ["cn_source"]); +__PACKAGE__->belongs_to( + "class_sort_rule", + "C4::Schema::Result::ClassSortRules", + { class_sort_rule => "class_sort_rule" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3m3sNlc8jVF2T4nrs3mKyw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Currency.pm b/C4/Schema/Result/Currency.pm new file mode 100644 index 0000000..64f823e --- /dev/null +++ b/C4/Schema/Result/Currency.pm @@ -0,0 +1,43 @@ +package C4::Schema::Result::Currency; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("currency"); +__PACKAGE__->add_columns( + "currency", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "symbol", + { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 5 }, + "timestamp", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, + "rate", + { data_type => "FLOAT", default_value => undef, is_nullable => 1, size => 32 }, +); +__PACKAGE__->set_primary_key("currency"); +__PACKAGE__->has_many( + "aqbooksellers_listprices", + "C4::Schema::Result::Aqbooksellers", + { "foreign.listprice" => "self.currency" }, +); +__PACKAGE__->has_many( + "aqbooksellers_invoiceprices", + "C4::Schema::Result::Aqbooksellers", + { "foreign.invoiceprice" => "self.currency" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9PpH/LZU0FNxmNu0tKFFdw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/DefaultBorrowerCircRules.pm b/C4/Schema/Result/DefaultBorrowerCircRules.pm new file mode 100644 index 0000000..c708297 --- /dev/null +++ b/C4/Schema/Result/DefaultBorrowerCircRules.pm @@ -0,0 +1,29 @@ +package C4::Schema::Result::DefaultBorrowerCircRules; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("default_borrower_circ_rules"); +__PACKAGE__->add_columns( + "categorycode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "maxissueqty", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 4 }, +); +__PACKAGE__->set_primary_key("categorycode"); +__PACKAGE__->belongs_to( + "categorycode", + "C4::Schema::Result::Categories", + { categorycode => "categorycode" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0P46tnUY1WWKiV/jRsLGQg + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/DefaultBranchCircRules.pm b/C4/Schema/Result/DefaultBranchCircRules.pm new file mode 100644 index 0000000..be388fa --- /dev/null +++ b/C4/Schema/Result/DefaultBranchCircRules.pm @@ -0,0 +1,29 @@ +package C4::Schema::Result::DefaultBranchCircRules; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("default_branch_circ_rules"); +__PACKAGE__->add_columns( + "branchcode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "maxissueqty", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 4 }, +); +__PACKAGE__->set_primary_key("branchcode"); +__PACKAGE__->belongs_to( + "branchcode", + "C4::Schema::Result::Branches", + { branchcode => "branchcode" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2X2/yYh4te62qszgx3bJqw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/DefaultCircRules.pm b/C4/Schema/Result/DefaultCircRules.pm new file mode 100644 index 0000000..1652000 --- /dev/null +++ b/C4/Schema/Result/DefaultCircRules.pm @@ -0,0 +1,29 @@ +package C4::Schema::Result::DefaultCircRules; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("default_circ_rules"); +__PACKAGE__->add_columns( + "singleton", + { + data_type => "ENUM", + default_value => "singleton", + is_nullable => 0, + size => 9, + }, + "maxissueqty", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 4 }, +); +__PACKAGE__->set_primary_key("singleton"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:i3OJfRCsXvTEgPYpYxglwg + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Deletedbiblio.pm b/C4/Schema/Result/Deletedbiblio.pm new file mode 100644 index 0000000..0a64c6b --- /dev/null +++ b/C4/Schema/Result/Deletedbiblio.pm @@ -0,0 +1,84 @@ +package C4::Schema::Result::Deletedbiblio; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("deletedbiblio"); +__PACKAGE__->add_columns( + "biblionumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "frameworkcode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 4 }, + "author", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "title", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "unititle", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "notes", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "serial", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 1 }, + "seriestitle", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "copyrightdate", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "timestamp", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, + "datecreated", + { data_type => "DATE", default_value => "", is_nullable => 0, size => 10 }, + "abstract", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, +); +__PACKAGE__->set_primary_key("biblionumber"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dCCfkXmzpuXtLEWZ5PZSRw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Deletedbiblioitems.pm b/C4/Schema/Result/Deletedbiblioitems.pm new file mode 100644 index 0000000..4c53e9e --- /dev/null +++ b/C4/Schema/Result/Deletedbiblioitems.pm @@ -0,0 +1,219 @@ +package C4::Schema::Result::Deletedbiblioitems; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("deletedbiblioitems"); +__PACKAGE__->add_columns( + "biblioitemnumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "biblionumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "volume", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "number", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "itemtype", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "isbn", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 14, + }, + "issn", + { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 9 }, + "publicationyear", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "publishercode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "volumedate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "volumedesc", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "collectiontitle", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "collectionissn", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "collectionvolume", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "editionstatement", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "editionresponsibility", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "timestamp", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, + "illus", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "pages", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "notes", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "size", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "place", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "lccn", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 25, + }, + "marc", + { + data_type => "LONGBLOB", + default_value => undef, + is_nullable => 1, + size => 4294967295, + }, + "url", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "cn_source", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "cn_class", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 30, + }, + "cn_item", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "cn_suffix", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "cn_sort", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 30, + }, + "totalissues", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 10 }, + "marcxml", + { + data_type => "LONGTEXT", + default_value => "", + is_nullable => 0, + size => 4294967295, + }, +); +__PACKAGE__->set_primary_key("biblioitemnumber"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hnTINNW7VSr/pmDuUGOM7A + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Deletedborrowers.pm b/C4/Schema/Result/Deletedborrowers.pm new file mode 100644 index 0000000..0fea345 --- /dev/null +++ b/C4/Schema/Result/Deletedborrowers.pm @@ -0,0 +1,353 @@ +package C4::Schema::Result::Deletedborrowers; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("deletedborrowers"); +__PACKAGE__->add_columns( + "borrowernumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "cardnumber", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 9 }, + "surname", + { + data_type => "MEDIUMTEXT", + default_value => "", + is_nullable => 0, + size => 16777215, + }, + "firstname", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "title", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "othernames", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "initials", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "streetnumber", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "streettype", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 50, + }, + "address", + { + data_type => "MEDIUMTEXT", + default_value => "", + is_nullable => 0, + size => 16777215, + }, + "address2", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "city", + { + data_type => "MEDIUMTEXT", + default_value => "", + is_nullable => 0, + size => 16777215, + }, + "zipcode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 25, + }, + "email", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "phone", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "mobile", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 50, + }, + "fax", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "emailpro", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "phonepro", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "b_streetnumber", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "b_streettype", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 50, + }, + "b_address", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 100, + }, + "b_city", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "b_zipcode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 25, + }, + "b_email", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "b_phone", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "dateofbirth", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "branchcode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "categorycode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "dateenrolled", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "dateexpiry", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "gonenoaddress", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 1 }, + "lost", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 1 }, + "debarred", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 1 }, + "contactname", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "contactfirstname", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "contacttitle", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "guarantorid", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "borrowernotes", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "relationship", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 100, + }, + "ethnicity", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 50, + }, + "ethnotes", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "sex", + { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 1 }, + "password", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 30, + }, + "flags", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "userid", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 30, + }, + "opacnote", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "contactnote", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "sort1", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 80, + }, + "sort2", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 80, + }, + "altcontactfirstname", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "altcontactsurname", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "altcontactaddress1", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "altcontactaddress2", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "altcontactaddress3", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "altcontactzipcode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 50, + }, + "altcontactphone", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 50, + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:yeLIQvzLLlmX62iwltJpzw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Deleteditems.pm b/C4/Schema/Result/Deleteditems.pm new file mode 100644 index 0000000..6e37b4d --- /dev/null +++ b/C4/Schema/Result/Deleteditems.pm @@ -0,0 +1,206 @@ +package C4::Schema::Result::Deleteditems; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("deleteditems"); +__PACKAGE__->add_columns( + "itemnumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "biblionumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "biblioitemnumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "barcode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 20, + }, + "dateaccessioned", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "booksellerid", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "homebranch", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "price", + { data_type => "DECIMAL", default_value => undef, is_nullable => 1, size => 8 }, + "replacementprice", + { data_type => "DECIMAL", default_value => undef, is_nullable => 1, size => 8 }, + "replacementpricedate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "datelastborrowed", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "datelastseen", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "stack", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 1 }, + "notforloan", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 }, + "damaged", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 }, + "itemlost", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 }, + "wthdrawn", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 }, + "itemcallnumber", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 30, + }, + "issues", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "renewals", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "reserves", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "restricted", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 1 }, + "itemnotes", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "holdingbranch", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "paidfor", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "timestamp", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, + "location", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 80, + }, + "onloan", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "cn_source", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "cn_sort", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 30, + }, + "ccode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "materials", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "uri", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "itype", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "more_subfields_xml", + { + data_type => "LONGTEXT", + default_value => undef, + is_nullable => 1, + size => 4294967295, + }, + "enumchron", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 80, + }, + "copynumber", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 32, + }, + "marc", + { + data_type => "LONGBLOB", + default_value => undef, + is_nullable => 1, + size => 4294967295, + }, +); +__PACKAGE__->set_primary_key("itemnumber"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:NV1mCeyzmDtazGCaTcEcIQ + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Ethnicity.pm b/C4/Schema/Result/Ethnicity.pm new file mode 100644 index 0000000..73f296e --- /dev/null +++ b/C4/Schema/Result/Ethnicity.pm @@ -0,0 +1,29 @@ +package C4::Schema::Result::Ethnicity; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("ethnicity"); +__PACKAGE__->add_columns( + "code", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "name", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, +); +__PACKAGE__->set_primary_key("code"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nvorEGo7Z21v+4miIH14Gg + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/HoldFillTargets.pm b/C4/Schema/Result/HoldFillTargets.pm new file mode 100644 index 0000000..f745ee6 --- /dev/null +++ b/C4/Schema/Result/HoldFillTargets.pm @@ -0,0 +1,55 @@ +package C4::Schema::Result::HoldFillTargets; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("hold_fill_targets"); +__PACKAGE__->add_columns( + "borrowernumber", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, + "biblionumber", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, + "itemnumber", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, + "source_branchcode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "item_level_request", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 4 }, +); +__PACKAGE__->set_primary_key("itemnumber"); +__PACKAGE__->belongs_to( + "borrowernumber", + "C4::Schema::Result::Borrowers", + { borrowernumber => "borrowernumber" }, +); +__PACKAGE__->belongs_to( + "biblionumber", + "C4::Schema::Result::Biblio", + { biblionumber => "biblionumber" }, +); +__PACKAGE__->belongs_to( + "itemnumber", + "C4::Schema::Result::Items", + { itemnumber => "itemnumber" }, +); +__PACKAGE__->belongs_to( + "source_branchcode", + "C4::Schema::Result::Branches", + { branchcode => "source_branchcode" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CpHguLZNDyCzbZIhIlUG7w + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/ImportBatches.pm b/C4/Schema/Result/ImportBatches.pm new file mode 100644 index 0000000..fecc986 --- /dev/null +++ b/C4/Schema/Result/ImportBatches.pm @@ -0,0 +1,93 @@ +package C4::Schema::Result::ImportBatches; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("import_batches"); +__PACKAGE__->add_columns( + "import_batch_id", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "matcher_id", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "template_id", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "branchcode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "num_biblios", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "num_items", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "upload_timestamp", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, + "overlay_action", + { + data_type => "ENUM", + default_value => "create_new", + is_nullable => 0, + size => 12, + }, + "nomatch_action", + { + data_type => "ENUM", + default_value => "create_new", + is_nullable => 0, + size => 10, + }, + "item_action", + { + data_type => "ENUM", + default_value => "always_add", + is_nullable => 0, + size => 20, + }, + "import_status", + { + data_type => "ENUM", + default_value => "staging", + is_nullable => 0, + size => 9, + }, + "batch_type", + { data_type => "ENUM", default_value => "batch", is_nullable => 0, size => 5 }, + "file_name", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 100, + }, + "comments", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, +); +__PACKAGE__->set_primary_key("import_batch_id"); +__PACKAGE__->has_many( + "import_records", + "C4::Schema::Result::ImportRecords", + { "foreign.import_batch_id" => "self.import_batch_id" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:cOnQTxzwsjn1fE9Ch2BE9A + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/ImportBiblios.pm b/C4/Schema/Result/ImportBiblios.pm new file mode 100644 index 0000000..72423ac --- /dev/null +++ b/C4/Schema/Result/ImportBiblios.pm @@ -0,0 +1,67 @@ +package C4::Schema::Result::ImportBiblios; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("import_biblios"); +__PACKAGE__->add_columns( + "import_record_id", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, + "matched_biblionumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "control_number", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 25, + }, + "original_source", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 25, + }, + "title", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 128, + }, + "author", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 80, + }, + "isbn", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 14, + }, + "issn", + { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 9 }, + "has_items", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 }, +); +__PACKAGE__->belongs_to( + "import_record_id", + "C4::Schema::Result::ImportRecords", + { import_record_id => "import_record_id" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FOUZqvCh/eMb5ICgkIwgwA + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/ImportItems.pm b/C4/Schema/Result/ImportItems.pm new file mode 100644 index 0000000..c5f9eb5 --- /dev/null +++ b/C4/Schema/Result/ImportItems.pm @@ -0,0 +1,54 @@ +package C4::Schema::Result::ImportItems; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("import_items"); +__PACKAGE__->add_columns( + "import_items_id", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "import_record_id", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, + "itemnumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "branchcode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "status", + { data_type => "ENUM", default_value => "staged", is_nullable => 0, size => 8 }, + "marcxml", + { + data_type => "LONGTEXT", + default_value => "", + is_nullable => 0, + size => 4294967295, + }, + "import_error", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, +); +__PACKAGE__->set_primary_key("import_items_id"); +__PACKAGE__->belongs_to( + "import_record_id", + "C4::Schema::Result::ImportRecords", + { import_record_id => "import_record_id" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dYyd29pAaqNM+cMAhpBj8w + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/ImportRecordMatches.pm b/C4/Schema/Result/ImportRecordMatches.pm new file mode 100644 index 0000000..059b83d --- /dev/null +++ b/C4/Schema/Result/ImportRecordMatches.pm @@ -0,0 +1,30 @@ +package C4::Schema::Result::ImportRecordMatches; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("import_record_matches"); +__PACKAGE__->add_columns( + "import_record_id", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, + "candidate_match_id", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, + "score", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, +); +__PACKAGE__->belongs_to( + "import_record_id", + "C4::Schema::Result::ImportRecords", + { import_record_id => "import_record_id" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+XLy+CNxPM/VbRweHrLlQg + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/ImportRecords.pm b/C4/Schema/Result/ImportRecords.pm new file mode 100644 index 0000000..be43e5b --- /dev/null +++ b/C4/Schema/Result/ImportRecords.pm @@ -0,0 +1,115 @@ +package C4::Schema::Result::ImportRecords; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("import_records"); +__PACKAGE__->add_columns( + "import_record_id", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "import_batch_id", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, + "branchcode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "record_sequence", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "upload_timestamp", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, + "import_date", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "marc", + { + data_type => "LONGBLOB", + default_value => "", + is_nullable => 0, + size => 4294967295, + }, + "marcxml", + { + data_type => "LONGTEXT", + default_value => "", + is_nullable => 0, + size => 4294967295, + }, + "marcxml_old", + { + data_type => "LONGTEXT", + default_value => "", + is_nullable => 0, + size => 4294967295, + }, + "record_type", + { data_type => "ENUM", default_value => "biblio", is_nullable => 0, size => 8 }, + "overlay_status", + { + data_type => "ENUM", + default_value => "no_match", + is_nullable => 0, + size => 13, + }, + "status", + { + data_type => "ENUM", + default_value => "staged", + is_nullable => 0, + size => 14, + }, + "import_error", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "encoding", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 40 }, + "z3950random", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 40, + }, +); +__PACKAGE__->set_primary_key("import_record_id"); +__PACKAGE__->has_many( + "import_biblios", + "C4::Schema::Result::ImportBiblios", + { "foreign.import_record_id" => "self.import_record_id" }, +); +__PACKAGE__->has_many( + "import_items", + "C4::Schema::Result::ImportItems", + { "foreign.import_record_id" => "self.import_record_id" }, +); +__PACKAGE__->has_many( + "import_record_matches", + "C4::Schema::Result::ImportRecordMatches", + { "foreign.import_record_id" => "self.import_record_id" }, +); +__PACKAGE__->belongs_to( + "import_batch_id", + "C4::Schema::Result::ImportBatches", + { import_batch_id => "import_batch_id" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:v6to9vVL04lbpCdk/2vioA + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Issues.pm b/C4/Schema/Result/Issues.pm new file mode 100644 index 0000000..08771e5 --- /dev/null +++ b/C4/Schema/Result/Issues.pm @@ -0,0 +1,66 @@ +package C4::Schema::Result::Issues; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("issues"); +__PACKAGE__->add_columns( + "borrowernumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "itemnumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "date_due", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "branchcode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "issuingbranch", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 18, + }, + "returndate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "lastreneweddate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "return", + { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 4 }, + "renewals", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 4 }, + "timestamp", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, + "issuedate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, +); +__PACKAGE__->belongs_to( + "borrowernumber", + "C4::Schema::Result::Borrowers", + { borrowernumber => "borrowernumber" }, +); +__PACKAGE__->belongs_to( + "itemnumber", + "C4::Schema::Result::Items", + { itemnumber => "itemnumber" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IwQ/ioR5Nb7+0kRW8EOzeg + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Issuingrules.pm b/C4/Schema/Result/Issuingrules.pm new file mode 100644 index 0000000..d902de8 --- /dev/null +++ b/C4/Schema/Result/Issuingrules.pm @@ -0,0 +1,66 @@ +package C4::Schema::Result::Issuingrules; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("issuingrules"); +__PACKAGE__->add_columns( + "categorycode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "itemtype", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "restrictedtype", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 1 }, + "rentaldiscount", + { + data_type => "DECIMAL", + default_value => undef, + is_nullable => 1, + size => 28, + }, + "reservecharge", + { + data_type => "DECIMAL", + default_value => undef, + is_nullable => 1, + size => 28, + }, + "fine", + { + data_type => "DECIMAL", + default_value => undef, + is_nullable => 1, + size => 28, + }, + "firstremind", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "chargeperiod", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "accountsent", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "chargename", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 100, + }, + "maxissueqty", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 4 }, + "issuelength", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 4 }, + "branchcode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, +); +__PACKAGE__->set_primary_key("branchcode", "categorycode", "itemtype"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1KbmFkZeVriCGrjwaiSxqQ + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Items.pm b/C4/Schema/Result/Items.pm new file mode 100644 index 0000000..362c687 --- /dev/null +++ b/C4/Schema/Result/Items.pm @@ -0,0 +1,250 @@ +package C4::Schema::Result::Items; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("items"); +__PACKAGE__->add_columns( + "itemnumber", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "biblionumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "biblioitemnumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "barcode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 20, + }, + "dateaccessioned", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "booksellerid", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "homebranch", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "price", + { data_type => "DECIMAL", default_value => undef, is_nullable => 1, size => 8 }, + "replacementprice", + { data_type => "DECIMAL", default_value => undef, is_nullable => 1, size => 8 }, + "replacementpricedate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "datelastborrowed", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "datelastseen", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "stack", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 1 }, + "notforloan", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 }, + "damaged", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 }, + "itemlost", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 }, + "wthdrawn", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 }, + "itemcallnumber", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 30, + }, + "issues", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "renewals", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "reserves", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "restricted", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 1 }, + "itemnotes", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "holdingbranch", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "paidfor", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "timestamp", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, + "location", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 80, + }, + "onloan", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "cn_source", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "cn_sort", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 30, + }, + "ccode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "materials", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "uri", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "itype", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "more_subfields_xml", + { + data_type => "LONGTEXT", + default_value => undef, + is_nullable => 1, + size => 4294967295, + }, + "enumchron", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 80, + }, + "copynumber", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 32, + }, +); +__PACKAGE__->set_primary_key("itemnumber"); +__PACKAGE__->add_unique_constraint("itembarcodeidx", ["barcode"]); +__PACKAGE__->has_many( + "accountlines", + "C4::Schema::Result::Accountlines", + { "foreign.itemnumber" => "self.itemnumber" }, +); +__PACKAGE__->has_many( + "branchtransfers", + "C4::Schema::Result::Branchtransfers", + { "foreign.itemnumber" => "self.itemnumber" }, +); +__PACKAGE__->has_many( + "hold_fill_targets", + "C4::Schema::Result::HoldFillTargets", + { "foreign.itemnumber" => "self.itemnumber" }, +); +__PACKAGE__->has_many( + "issues", + "C4::Schema::Result::Issues", + { "foreign.itemnumber" => "self.itemnumber" }, +); +__PACKAGE__->belongs_to( + "biblioitemnumber", + "C4::Schema::Result::Biblioitems", + { biblioitemnumber => "biblioitemnumber" }, +); +__PACKAGE__->belongs_to( + "homebranch", + "C4::Schema::Result::Branches", + { branchcode => "homebranch" }, +); +__PACKAGE__->belongs_to( + "holdingbranch", + "C4::Schema::Result::Branches", + { branchcode => "holdingbranch" }, +); +__PACKAGE__->has_many( + "old_issues", + "C4::Schema::Result::OldIssues", + { "foreign.itemnumber" => "self.itemnumber" }, +); +__PACKAGE__->has_many( + "old_reserves", + "C4::Schema::Result::OldReserves", + { "foreign.itemnumber" => "self.itemnumber" }, +); +__PACKAGE__->has_many( + "reserves", + "C4::Schema::Result::Reserves", + { "foreign.itemnumber" => "self.itemnumber" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Jgozgzjh3hu7sX2KasfXzA + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Itemtypes.pm b/C4/Schema/Result/Itemtypes.pm new file mode 100644 index 0000000..7092639 --- /dev/null +++ b/C4/Schema/Result/Itemtypes.pm @@ -0,0 +1,60 @@ +package C4::Schema::Result::Itemtypes; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("itemtypes"); +__PACKAGE__->add_columns( + "itemtype", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "description", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "renewalsallowed", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "rentalcharge", + { data_type => "DOUBLE", default_value => undef, is_nullable => 1, size => 64 }, + "notforloan", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "imageurl", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 200, + }, + "summary", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, +); +__PACKAGE__->set_primary_key("itemtype"); +__PACKAGE__->add_unique_constraint("itemtype", ["itemtype"]); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:k+n1E+2/hI9ZMzmHZ6QV0g + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Labels.pm b/C4/Schema/Result/Labels.pm new file mode 100644 index 0000000..b7b5114 --- /dev/null +++ b/C4/Schema/Result/Labels.pm @@ -0,0 +1,33 @@ +package C4::Schema::Result::Labels; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("labels"); +__PACKAGE__->add_columns( + "labelid", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "batch_id", + { data_type => "VARCHAR", default_value => 1, is_nullable => 0, size => 10 }, + "itemnumber", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 100 }, + "timestamp", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, +); +__PACKAGE__->set_primary_key("labelid"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Io25W+bAd6Q1kTHOeMKk6w + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/LabelsConf.pm b/C4/Schema/Result/LabelsConf.pm new file mode 100644 index 0000000..14c9611 --- /dev/null +++ b/C4/Schema/Result/LabelsConf.pm @@ -0,0 +1,71 @@ +package C4::Schema::Result::LabelsConf; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("labels_conf"); +__PACKAGE__->add_columns( + "id", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 4 }, + "barcodetype", + { data_type => "CHAR", default_value => "", is_nullable => 1, size => 100 }, + "title", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 1 }, + "subtitle", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 1 }, + "itemtype", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 1 }, + "barcode", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 1 }, + "dewey", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 1 }, + "classification", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 1 }, + "subclass", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 1 }, + "itemcallnumber", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 1 }, + "author", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 1 }, + "issn", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 1 }, + "isbn", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 1 }, + "startlabel", + { data_type => "INT", default_value => 1, is_nullable => 0, size => 2 }, + "printingtype", + { data_type => "CHAR", default_value => "BAR", is_nullable => 1, size => 32 }, + "formatstring", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 64, + }, + "layoutname", + { data_type => "CHAR", default_value => "TEST", is_nullable => 0, size => 20 }, + "guidebox", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 1 }, + "active", + { data_type => "TINYINT", default_value => 1, is_nullable => 1, size => 1 }, + "fonttype", + { data_type => "CHAR", default_value => undef, is_nullable => 1, size => 10 }, + "ccode", + { data_type => "CHAR", default_value => undef, is_nullable => 1, size => 4 }, + "callnum_split", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 1 }, + "text_justify", + { data_type => "CHAR", default_value => undef, is_nullable => 1, size => 1 }, +); +__PACKAGE__->set_primary_key("id"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uIWFfiEmjJkBAUTOdaL/mg + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/LabelsProfile.pm b/C4/Schema/Result/LabelsProfile.pm new file mode 100644 index 0000000..63e3cc0 --- /dev/null +++ b/C4/Schema/Result/LabelsProfile.pm @@ -0,0 +1,25 @@ +package C4::Schema::Result::LabelsProfile; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("labels_profile"); +__PACKAGE__->add_columns( + "tmpl_id", + { data_type => "INT", default_value => "", is_nullable => 0, size => 4 }, + "prof_id", + { data_type => "INT", default_value => "", is_nullable => 0, size => 4 }, +); +__PACKAGE__->add_unique_constraint("tmpl_id", ["tmpl_id"]); +__PACKAGE__->add_unique_constraint("prof_id", ["prof_id"]); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:E3J9cT1JxiDEQj00oImwEw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/LabelsTemplates.pm b/C4/Schema/Result/LabelsTemplates.pm new file mode 100644 index 0000000..70b1fbd --- /dev/null +++ b/C4/Schema/Result/LabelsTemplates.pm @@ -0,0 +1,59 @@ +package C4::Schema::Result::LabelsTemplates; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("labels_templates"); +__PACKAGE__->add_columns( + "tmpl_id", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 4 }, + "tmpl_code", + { data_type => "CHAR", default_value => "", is_nullable => 1, size => 100 }, + "tmpl_desc", + { data_type => "CHAR", default_value => "", is_nullable => 1, size => 100 }, + "page_width", + { data_type => "FLOAT", default_value => 0, is_nullable => 1, size => 32 }, + "page_height", + { data_type => "FLOAT", default_value => 0, is_nullable => 1, size => 32 }, + "label_width", + { data_type => "FLOAT", default_value => 0, is_nullable => 1, size => 32 }, + "label_height", + { data_type => "FLOAT", default_value => 0, is_nullable => 1, size => 32 }, + "topmargin", + { data_type => "FLOAT", default_value => 0, is_nullable => 1, size => 32 }, + "leftmargin", + { data_type => "FLOAT", default_value => 0, is_nullable => 1, size => 32 }, + "cols", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 2 }, + "rows", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 2 }, + "colgap", + { data_type => "FLOAT", default_value => 0, is_nullable => 1, size => 32 }, + "rowgap", + { data_type => "FLOAT", default_value => 0, is_nullable => 1, size => 32 }, + "active", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 1 }, + "units", + { data_type => "CHAR", default_value => "PX", is_nullable => 1, size => 20 }, + "fontsize", + { data_type => "INT", default_value => 3, is_nullable => 0, size => 4 }, + "font", + { data_type => "CHAR", default_value => "TR", is_nullable => 0, size => 10 }, +); +__PACKAGE__->set_primary_key("tmpl_id"); +__PACKAGE__->has_many( + "printers_profiles", + "C4::Schema::Result::PrintersProfile", + { "foreign.tmpl_id" => "self.tmpl_id" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:EzU9tc/xhRMYb4x3ZwZOfw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/LanguageDescriptions.pm b/C4/Schema/Result/LanguageDescriptions.pm new file mode 100644 index 0000000..73e1c06 --- /dev/null +++ b/C4/Schema/Result/LanguageDescriptions.pm @@ -0,0 +1,47 @@ +package C4::Schema::Result::LanguageDescriptions; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("language_descriptions"); +__PACKAGE__->add_columns( + "subtag", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 25, + }, + "type", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 25, + }, + "lang", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 25, + }, + "description", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IqYgHTaFoOfkTCoHfl8yfw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/LanguageRfc4646ToIso639.pm b/C4/Schema/Result/LanguageRfc4646ToIso639.pm new file mode 100644 index 0000000..58f479e --- /dev/null +++ b/C4/Schema/Result/LanguageRfc4646ToIso639.pm @@ -0,0 +1,33 @@ +package C4::Schema::Result::LanguageRfc4646ToIso639; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("language_rfc4646_to_iso639"); +__PACKAGE__->add_columns( + "rfc4646_subtag", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 25, + }, + "iso639_2_code", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 25, + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3o4NHyelc2qDOMqBzNOr9w + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/LanguageScriptBidi.pm b/C4/Schema/Result/LanguageScriptBidi.pm new file mode 100644 index 0000000..18726c1 --- /dev/null +++ b/C4/Schema/Result/LanguageScriptBidi.pm @@ -0,0 +1,28 @@ +package C4::Schema::Result::LanguageScriptBidi; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("language_script_bidi"); +__PACKAGE__->add_columns( + "rfc4646_subtag", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 25, + }, + "bidi", + { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 3 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:EReSfQ4NVRkBLX58rRgR0g + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/LanguageScriptMapping.pm b/C4/Schema/Result/LanguageScriptMapping.pm new file mode 100644 index 0000000..c493d2b --- /dev/null +++ b/C4/Schema/Result/LanguageScriptMapping.pm @@ -0,0 +1,33 @@ +package C4::Schema::Result::LanguageScriptMapping; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("language_script_mapping"); +__PACKAGE__->add_columns( + "language_subtag", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 25, + }, + "script_subtag", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 25, + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HO0wNx94gtz1pk3HoC04Og + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/LanguageSubtagRegistry.pm b/C4/Schema/Result/LanguageSubtagRegistry.pm new file mode 100644 index 0000000..a638620 --- /dev/null +++ b/C4/Schema/Result/LanguageSubtagRegistry.pm @@ -0,0 +1,42 @@ +package C4::Schema::Result::LanguageSubtagRegistry; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("language_subtag_registry"); +__PACKAGE__->add_columns( + "subtag", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 25, + }, + "type", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 25, + }, + "description", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 25, + }, + "added", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2Vupx4BN70pV2bBXkg1S0g + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Letter.pm b/C4/Schema/Result/Letter.pm new file mode 100644 index 0000000..6e066d0 --- /dev/null +++ b/C4/Schema/Result/Letter.pm @@ -0,0 +1,43 @@ +package C4::Schema::Result::Letter; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("letter"); +__PACKAGE__->add_columns( + "module", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 20 }, + "code", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 20 }, + "name", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 100 }, + "title", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 200 }, + "content", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, +); +__PACKAGE__->set_primary_key("module", "code"); +__PACKAGE__->has_many( + "message_transports", + "C4::Schema::Result::MessageTransports", + { + "foreign.letter_code" => "self.code", + "foreign.letter_module" => "self.module", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:l1W92zVzI2OnVNA6D2XBTQ + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/MarcMatchers.pm b/C4/Schema/Result/MarcMatchers.pm new file mode 100644 index 0000000..6f6c0cd --- /dev/null +++ b/C4/Schema/Result/MarcMatchers.pm @@ -0,0 +1,50 @@ +package C4::Schema::Result::MarcMatchers; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("marc_matchers"); +__PACKAGE__->add_columns( + "matcher_id", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "code", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "description", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 255 }, + "record_type", + { + data_type => "VARCHAR", + default_value => "biblio", + is_nullable => 0, + size => 10, + }, + "threshold", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, +); +__PACKAGE__->set_primary_key("matcher_id"); +__PACKAGE__->has_many( + "matchchecks", + "C4::Schema::Result::Matchchecks", + { "foreign.matcher_id" => "self.matcher_id" }, +); +__PACKAGE__->has_many( + "matcher_matchpoints", + "C4::Schema::Result::MatcherMatchpoints", + { "foreign.matcher_id" => "self.matcher_id" }, +); +__PACKAGE__->has_many( + "matchpoints", + "C4::Schema::Result::Matchpoints", + { "foreign.matcher_id" => "self.matcher_id" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:85Bud6BU24JAI48I7MWGUw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/MarcSubfieldStructure.pm b/C4/Schema/Result/MarcSubfieldStructure.pm new file mode 100644 index 0000000..e7c238a --- /dev/null +++ b/C4/Schema/Result/MarcSubfieldStructure.pm @@ -0,0 +1,89 @@ +package C4::Schema::Result::MarcSubfieldStructure; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("marc_subfield_structure"); +__PACKAGE__->add_columns( + "tagfield", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 3 }, + "tagsubfield", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 1 }, + "liblibrarian", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 255 }, + "libopac", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 255 }, + "repeatable", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 4 }, + "mandatory", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 4 }, + "kohafield", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 40, + }, + "tab", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 1 }, + "authorised_value", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 20, + }, + "authtypecode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 20, + }, + "value_builder", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 80, + }, + "isurl", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 1 }, + "hidden", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 1 }, + "frameworkcode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 4 }, + "seealso", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 1100, + }, + "link", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 80, + }, + "defaultvalue", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, +); +__PACKAGE__->set_primary_key("frameworkcode", "tagfield", "tagsubfield"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2aqUl9EFukY63eqoQu04uw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/MarcTagStructure.pm b/C4/Schema/Result/MarcTagStructure.pm new file mode 100644 index 0000000..f064cf7 --- /dev/null +++ b/C4/Schema/Result/MarcTagStructure.pm @@ -0,0 +1,39 @@ +package C4::Schema::Result::MarcTagStructure; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("marc_tag_structure"); +__PACKAGE__->add_columns( + "tagfield", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 3 }, + "liblibrarian", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 255 }, + "libopac", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 255 }, + "repeatable", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 4 }, + "mandatory", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 4 }, + "authorised_value", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "frameworkcode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 4 }, +); +__PACKAGE__->set_primary_key("frameworkcode", "tagfield"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zwfUzZZSoLSpIGNL5p9aVw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Matchchecks.pm b/C4/Schema/Result/Matchchecks.pm new file mode 100644 index 0000000..323c27b --- /dev/null +++ b/C4/Schema/Result/Matchchecks.pm @@ -0,0 +1,43 @@ +package C4::Schema::Result::Matchchecks; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("matchchecks"); +__PACKAGE__->add_columns( + "matcher_id", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, + "matchcheck_id", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "source_matchpoint_id", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, + "target_matchpoint_id", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, +); +__PACKAGE__->set_primary_key("matchcheck_id"); +__PACKAGE__->belongs_to( + "matcher_id", + "C4::Schema::Result::MarcMatchers", + { matcher_id => "matcher_id" }, +); +__PACKAGE__->belongs_to( + "source_matchpoint_id", + "C4::Schema::Result::Matchpoints", + { matchpoint_id => "source_matchpoint_id" }, +); +__PACKAGE__->belongs_to( + "target_matchpoint_id", + "C4::Schema::Result::Matchpoints", + { matchpoint_id => "target_matchpoint_id" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:d1kL7CN8X3vfcJjpMsUg9g + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/MatcherMatchpoints.pm b/C4/Schema/Result/MatcherMatchpoints.pm new file mode 100644 index 0000000..c6c10b9 --- /dev/null +++ b/C4/Schema/Result/MatcherMatchpoints.pm @@ -0,0 +1,33 @@ +package C4::Schema::Result::MatcherMatchpoints; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("matcher_matchpoints"); +__PACKAGE__->add_columns( + "matcher_id", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, + "matchpoint_id", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, +); +__PACKAGE__->belongs_to( + "matcher_id", + "C4::Schema::Result::MarcMatchers", + { matcher_id => "matcher_id" }, +); +__PACKAGE__->belongs_to( + "matchpoint_id", + "C4::Schema::Result::Matchpoints", + { matchpoint_id => "matchpoint_id" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:r5Tg41Rp2igOJstpY0DQwQ + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/MatchpointComponentNorms.pm b/C4/Schema/Result/MatchpointComponentNorms.pm new file mode 100644 index 0000000..a02da07 --- /dev/null +++ b/C4/Schema/Result/MatchpointComponentNorms.pm @@ -0,0 +1,30 @@ +package C4::Schema::Result::MatchpointComponentNorms; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("matchpoint_component_norms"); +__PACKAGE__->add_columns( + "matchpoint_component_id", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, + "sequence", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "norm_routine", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 50 }, +); +__PACKAGE__->belongs_to( + "matchpoint_component_id", + "C4::Schema::Result::MatchpointComponents", + { "matchpoint_component_id" => "matchpoint_component_id" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5b/AUd2kWMB+JyEMLqXR7Q + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/MatchpointComponents.pm b/C4/Schema/Result/MatchpointComponents.pm new file mode 100644 index 0000000..9dde3b0 --- /dev/null +++ b/C4/Schema/Result/MatchpointComponents.pm @@ -0,0 +1,46 @@ +package C4::Schema::Result::MatchpointComponents; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("matchpoint_components"); +__PACKAGE__->add_columns( + "matchpoint_id", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, + "matchpoint_component_id", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "sequence", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "tag", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 3 }, + "subfields", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 40 }, + "offset", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 4 }, + "length", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 4 }, +); +__PACKAGE__->set_primary_key("matchpoint_component_id"); +__PACKAGE__->has_many( + "matchpoint_component_norms", + "C4::Schema::Result::MatchpointComponentNorms", + { + "foreign.matchpoint_component_id" => "self.matchpoint_component_id", + }, +); +__PACKAGE__->belongs_to( + "matchpoint_id", + "C4::Schema::Result::Matchpoints", + { matchpoint_id => "matchpoint_id" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0PtMAMceAaaiHpz5RjkxCA + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Matchpoints.pm b/C4/Schema/Result/Matchpoints.pm new file mode 100644 index 0000000..13fbeee --- /dev/null +++ b/C4/Schema/Result/Matchpoints.pm @@ -0,0 +1,53 @@ +package C4::Schema::Result::Matchpoints; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("matchpoints"); +__PACKAGE__->add_columns( + "matcher_id", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, + "matchpoint_id", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "search_index", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 30 }, + "score", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, +); +__PACKAGE__->set_primary_key("matchpoint_id"); +__PACKAGE__->has_many( + "matchchecks_source_matchpoint_ids", + "C4::Schema::Result::Matchchecks", + { "foreign.source_matchpoint_id" => "self.matchpoint_id" }, +); +__PACKAGE__->has_many( + "matchchecks_target_matchpoint_ids", + "C4::Schema::Result::Matchchecks", + { "foreign.target_matchpoint_id" => "self.matchpoint_id" }, +); +__PACKAGE__->has_many( + "matcher_matchpoints", + "C4::Schema::Result::MatcherMatchpoints", + { "foreign.matchpoint_id" => "self.matchpoint_id" }, +); +__PACKAGE__->has_many( + "matchpoint_components", + "C4::Schema::Result::MatchpointComponents", + { "foreign.matchpoint_id" => "self.matchpoint_id" }, +); +__PACKAGE__->belongs_to( + "matcher_id", + "C4::Schema::Result::MarcMatchers", + { matcher_id => "matcher_id" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GOiUTG8BQtfJxIMqKBPhAA + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/MessageAttributes.pm b/C4/Schema/Result/MessageAttributes.pm new file mode 100644 index 0000000..751f118 --- /dev/null +++ b/C4/Schema/Result/MessageAttributes.pm @@ -0,0 +1,37 @@ +package C4::Schema::Result::MessageAttributes; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("message_attributes"); +__PACKAGE__->add_columns( + "message_attribute_id", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "message_name", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 20 }, + "takes_days", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 }, +); +__PACKAGE__->set_primary_key("message_attribute_id"); +__PACKAGE__->add_unique_constraint("message_name", ["message_name"]); +__PACKAGE__->has_many( + "borrower_message_preferences", + "C4::Schema::Result::BorrowerMessagePreferences", + { "foreign.message_attribute_id" => "self.message_attribute_id" }, +); +__PACKAGE__->has_many( + "message_transports", + "C4::Schema::Result::MessageTransports", + { "foreign.message_attribute_id" => "self.message_attribute_id" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:trAuBI3LAU5bopGeN+Dx5A + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/MessageQueue.pm b/C4/Schema/Result/MessageQueue.pm new file mode 100644 index 0000000..9dfd8a2 --- /dev/null +++ b/C4/Schema/Result/MessageQueue.pm @@ -0,0 +1,84 @@ +package C4::Schema::Result::MessageQueue; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("message_queue"); +__PACKAGE__->add_columns( + "message_id", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "borrowernumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "subject", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "content", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "message_transport_type", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 20 }, + "status", + { + data_type => "ENUM", + default_value => "pending", + is_nullable => 0, + size => 7, + }, + "time_queued", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, + "to_address", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "from_address", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "content_type", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, +); +__PACKAGE__->belongs_to( + "borrowernumber", + "C4::Schema::Result::Borrowers", + { borrowernumber => "borrowernumber" }, +); +__PACKAGE__->belongs_to( + "message_transport_type", + "C4::Schema::Result::MessageTransportTypes", + { "message_transport_type" => "message_transport_type" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/eu+ph/gsS1I2y7noZOMsg + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/MessageTransportTypes.pm b/C4/Schema/Result/MessageTransportTypes.pm new file mode 100644 index 0000000..85e270a --- /dev/null +++ b/C4/Schema/Result/MessageTransportTypes.pm @@ -0,0 +1,43 @@ +package C4::Schema::Result::MessageTransportTypes; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("message_transport_types"); +__PACKAGE__->add_columns( + "message_transport_type", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 20 }, +); +__PACKAGE__->set_primary_key("message_transport_type"); +__PACKAGE__->has_many( + "borrower_message_transport_preferences", + "C4::Schema::Result::BorrowerMessageTransportPreferences", + { + "foreign.message_transport_type" => "self.message_transport_type", + }, +); +__PACKAGE__->has_many( + "message_queues", + "C4::Schema::Result::MessageQueue", + { + "foreign.message_transport_type" => "self.message_transport_type", + }, +); +__PACKAGE__->has_many( + "message_transports", + "C4::Schema::Result::MessageTransports", + { + "foreign.message_transport_type" => "self.message_transport_type", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0Ot0nB6OkhmKEgP5WlPYDA + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/MessageTransports.pm b/C4/Schema/Result/MessageTransports.pm new file mode 100644 index 0000000..7ba2f8b --- /dev/null +++ b/C4/Schema/Result/MessageTransports.pm @@ -0,0 +1,45 @@ +package C4::Schema::Result::MessageTransports; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("message_transports"); +__PACKAGE__->add_columns( + "message_attribute_id", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, + "message_transport_type", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 20 }, + "is_digest", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 }, + "letter_module", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 20 }, + "letter_code", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 20 }, +); +__PACKAGE__->set_primary_key("message_attribute_id", "message_transport_type", "is_digest"); +__PACKAGE__->belongs_to( + "message_attribute_id", + "C4::Schema::Result::MessageAttributes", + { message_attribute_id => "message_attribute_id" }, +); +__PACKAGE__->belongs_to( + "message_transport_type", + "C4::Schema::Result::MessageTransportTypes", + { "message_transport_type" => "message_transport_type" }, +); +__PACKAGE__->belongs_to( + "letter", + "C4::Schema::Result::Letter", + { code => "letter_code", module => "letter_module" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Z/BNTyLqKfkj/kmu3Jsp+g + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Notifys.pm b/C4/Schema/Result/Notifys.pm new file mode 100644 index 0000000..9cf8bda --- /dev/null +++ b/C4/Schema/Result/Notifys.pm @@ -0,0 +1,33 @@ +package C4::Schema::Result::Notifys; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("notifys"); +__PACKAGE__->add_columns( + "notify_id", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "borrowernumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "itemnumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "notify_date", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "notify_send_date", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "notify_level", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 1 }, + "method", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 20 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ULe+YYilMW7hOuwPDAATrg + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Nozebra.pm b/C4/Schema/Result/Nozebra.pm new file mode 100644 index 0000000..5dfb52e --- /dev/null +++ b/C4/Schema/Result/Nozebra.pm @@ -0,0 +1,32 @@ +package C4::Schema::Result::Nozebra; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("nozebra"); +__PACKAGE__->add_columns( + "server", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 20 }, + "indexname", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 40 }, + "value", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 250 }, + "biblionumbers", + { + data_type => "LONGTEXT", + default_value => "", + is_nullable => 0, + size => 4294967295, + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:k/0O8vgz8ASmyGwQj1601w + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/OldIssues.pm b/C4/Schema/Result/OldIssues.pm new file mode 100644 index 0000000..af193f1 --- /dev/null +++ b/C4/Schema/Result/OldIssues.pm @@ -0,0 +1,66 @@ +package C4::Schema::Result::OldIssues; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("old_issues"); +__PACKAGE__->add_columns( + "borrowernumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "itemnumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "date_due", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "branchcode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "issuingbranch", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 18, + }, + "returndate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "lastreneweddate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "return", + { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 4 }, + "renewals", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 4 }, + "timestamp", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, + "issuedate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, +); +__PACKAGE__->belongs_to( + "borrowernumber", + "C4::Schema::Result::Borrowers", + { borrowernumber => "borrowernumber" }, +); +__PACKAGE__->belongs_to( + "itemnumber", + "C4::Schema::Result::Items", + { itemnumber => "itemnumber" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:j8umPsqXEPeXT8dIJlwY+Q + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/OldReserves.pm b/C4/Schema/Result/OldReserves.pm new file mode 100644 index 0000000..3256889 --- /dev/null +++ b/C4/Schema/Result/OldReserves.pm @@ -0,0 +1,82 @@ +package C4::Schema::Result::OldReserves; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("old_reserves"); +__PACKAGE__->add_columns( + "borrowernumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "reservedate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "biblionumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "constrainttype", + { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 1 }, + "branchcode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "notificationdate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "reminderdate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "cancellationdate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "reservenotes", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "priority", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "found", + { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 1 }, + "timestamp", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, + "itemnumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "waitingdate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, +); +__PACKAGE__->belongs_to( + "borrowernumber", + "C4::Schema::Result::Borrowers", + { borrowernumber => "borrowernumber" }, +); +__PACKAGE__->belongs_to( + "biblionumber", + "C4::Schema::Result::Biblio", + { biblionumber => "biblionumber" }, +); +__PACKAGE__->belongs_to( + "itemnumber", + "C4::Schema::Result::Items", + { itemnumber => "itemnumber" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:q1L8L9nF8B9xoZnpS0TxSQ + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/OpacNews.pm b/C4/Schema/Result/OpacNews.pm new file mode 100644 index 0000000..0841f7e --- /dev/null +++ b/C4/Schema/Result/OpacNews.pm @@ -0,0 +1,39 @@ +package C4::Schema::Result::OpacNews; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("opac_news"); +__PACKAGE__->add_columns( + "idnew", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 }, + "title", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 250 }, + "new", + { data_type => "TEXT", default_value => "", is_nullable => 0, size => 65535 }, + "lang", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 25 }, + "timestamp", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, + "expirationdate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "number", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, +); +__PACKAGE__->set_primary_key("idnew"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VkJ58Qv3rFkymtMXXOPHNQ + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Overduerules.pm b/C4/Schema/Result/Overduerules.pm new file mode 100644 index 0000000..1c96e0c --- /dev/null +++ b/C4/Schema/Result/Overduerules.pm @@ -0,0 +1,57 @@ +package C4::Schema::Result::Overduerules; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("overduerules"); +__PACKAGE__->add_columns( + "branchcode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "categorycode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "delay1", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 4 }, + "letter1", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 20, + }, + "debarred1", + { data_type => "VARCHAR", default_value => 0, is_nullable => 1, size => 1 }, + "delay2", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 4 }, + "debarred2", + { data_type => "VARCHAR", default_value => 0, is_nullable => 1, size => 1 }, + "letter2", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 20, + }, + "delay3", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 4 }, + "letter3", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 20, + }, + "debarred3", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 1 }, +); +__PACKAGE__->set_primary_key("branchcode", "categorycode"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OlEiDfshcIUaEPDg2/YlVQ + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Patroncards.pm b/C4/Schema/Result/Patroncards.pm new file mode 100644 index 0000000..0b72e82 --- /dev/null +++ b/C4/Schema/Result/Patroncards.pm @@ -0,0 +1,38 @@ +package C4::Schema::Result::Patroncards; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("patroncards"); +__PACKAGE__->add_columns( + "cardid", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "batch_id", + { data_type => "VARCHAR", default_value => 1, is_nullable => 0, size => 10 }, + "borrowernumber", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, + "timestamp", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, +); +__PACKAGE__->set_primary_key("cardid"); +__PACKAGE__->belongs_to( + "borrowernumber", + "C4::Schema::Result::Borrowers", + { borrowernumber => "borrowernumber" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uZGGgzSVtxChjjeqtMXKxg + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Patronimage.pm b/C4/Schema/Result/Patronimage.pm new file mode 100644 index 0000000..56eb2dc --- /dev/null +++ b/C4/Schema/Result/Patronimage.pm @@ -0,0 +1,36 @@ +package C4::Schema::Result::Patronimage; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("patronimage"); +__PACKAGE__->add_columns( + "cardnumber", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 16 }, + "mimetype", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 15 }, + "imagefile", + { + data_type => "MEDIUMBLOB", + default_value => "", + is_nullable => 0, + size => 16777215, + }, +); +__PACKAGE__->set_primary_key("cardnumber"); +__PACKAGE__->belongs_to( + "cardnumber", + "C4::Schema::Result::Borrowers", + { cardnumber => "cardnumber" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dcviLNUUh60LvSrUnaMWCg + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Permissions.pm b/C4/Schema/Result/Permissions.pm new file mode 100644 index 0000000..11692d3 --- /dev/null +++ b/C4/Schema/Result/Permissions.pm @@ -0,0 +1,44 @@ +package C4::Schema::Result::Permissions; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("permissions"); +__PACKAGE__->add_columns( + "module_bit", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "code", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 30 }, + "description", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, +); +__PACKAGE__->set_primary_key("module_bit", "code"); +__PACKAGE__->belongs_to( + "module_bit", + "C4::Schema::Result::Userflags", + { bit => "module_bit" }, +); +__PACKAGE__->has_many( + "user_permissions", + "C4::Schema::Result::UserPermissions", + { + "foreign.code" => "self.code", + "foreign.module_bit" => "self.module_bit", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:j0fCuDX9JIBWeovQllQJFA + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Printers.pm b/C4/Schema/Result/Printers.pm new file mode 100644 index 0000000..d0c708f --- /dev/null +++ b/C4/Schema/Result/Printers.pm @@ -0,0 +1,36 @@ +package C4::Schema::Result::Printers; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("printers"); +__PACKAGE__->add_columns( + "printername", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 40 }, + "printqueue", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 20, + }, + "printtype", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 20, + }, +); +__PACKAGE__->set_primary_key("printername"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Efs76sqxDKjvUHwD3E0ijw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/PrintersProfile.pm b/C4/Schema/Result/PrintersProfile.pm new file mode 100644 index 0000000..c007aa7 --- /dev/null +++ b/C4/Schema/Result/PrintersProfile.pm @@ -0,0 +1,44 @@ +package C4::Schema::Result::PrintersProfile; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("printers_profile"); +__PACKAGE__->add_columns( + "prof_id", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 4 }, + "printername", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 40 }, + "tmpl_id", + { data_type => "INT", default_value => "", is_nullable => 0, size => 4 }, + "paper_bin", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 20 }, + "offset_horz", + { data_type => "FLOAT", default_value => undef, is_nullable => 1, size => 32 }, + "offset_vert", + { data_type => "FLOAT", default_value => undef, is_nullable => 1, size => 32 }, + "creep_horz", + { data_type => "FLOAT", default_value => undef, is_nullable => 1, size => 32 }, + "creep_vert", + { data_type => "FLOAT", default_value => undef, is_nullable => 1, size => 32 }, + "unit", + { data_type => "CHAR", default_value => "POINT", is_nullable => 0, size => 20 }, +); +__PACKAGE__->set_primary_key("prof_id"); +__PACKAGE__->add_unique_constraint("printername", ["printername", "tmpl_id", "paper_bin"]); +__PACKAGE__->belongs_to( + "tmpl_id", + "C4::Schema::Result::LabelsTemplates", + { tmpl_id => "tmpl_id" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:I2zmakh/A1CAv4IusAw2UA + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/RepeatableHolidays.pm b/C4/Schema/Result/RepeatableHolidays.pm new file mode 100644 index 0000000..7183bfc --- /dev/null +++ b/C4/Schema/Result/RepeatableHolidays.pm @@ -0,0 +1,49 @@ +package C4::Schema::Result::RepeatableHolidays; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("repeatable_holidays"); +__PACKAGE__->add_columns( + "id", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "branchcode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "weekday", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "day", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "month", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "title", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 50 }, + "description", + { data_type => "TEXT", default_value => "", is_nullable => 0, size => 65535 }, +); +__PACKAGE__->set_primary_key("id"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xMzW780DzJs3WY9/g2gS8A + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/ReportsDictionary.pm b/C4/Schema/Result/ReportsDictionary.pm new file mode 100644 index 0000000..96c8c01 --- /dev/null +++ b/C4/Schema/Result/ReportsDictionary.pm @@ -0,0 +1,59 @@ +package C4::Schema::Result::ReportsDictionary; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("reports_dictionary"); +__PACKAGE__->add_columns( + "id", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "name", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "description", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "date_created", + { + data_type => "DATETIME", + default_value => undef, + is_nullable => 1, + size => 19, + }, + "date_modified", + { + data_type => "DATETIME", + default_value => undef, + is_nullable => 1, + size => 19, + }, + "saved_sql", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "area", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, +); +__PACKAGE__->set_primary_key("id"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:lmeMEPsPLcRiEhileHugCg + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Reserveconstraints.pm b/C4/Schema/Result/Reserveconstraints.pm new file mode 100644 index 0000000..3087cbe --- /dev/null +++ b/C4/Schema/Result/Reserveconstraints.pm @@ -0,0 +1,34 @@ +package C4::Schema::Result::Reserveconstraints; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("reserveconstraints"); +__PACKAGE__->add_columns( + "borrowernumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "reservedate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "biblionumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "biblioitemnumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "timestamp", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0sfmeS/3iojjqwjcPKnANA + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Reserves.pm b/C4/Schema/Result/Reserves.pm new file mode 100644 index 0000000..2f34931 --- /dev/null +++ b/C4/Schema/Result/Reserves.pm @@ -0,0 +1,87 @@ +package C4::Schema::Result::Reserves; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("reserves"); +__PACKAGE__->add_columns( + "borrowernumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "reservedate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "biblionumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "constrainttype", + { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 1 }, + "branchcode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "notificationdate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "reminderdate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "cancellationdate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "reservenotes", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "priority", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "found", + { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 1 }, + "timestamp", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, + "itemnumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "waitingdate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, +); +__PACKAGE__->belongs_to( + "borrowernumber", + "C4::Schema::Result::Borrowers", + { borrowernumber => "borrowernumber" }, +); +__PACKAGE__->belongs_to( + "biblionumber", + "C4::Schema::Result::Biblio", + { biblionumber => "biblionumber" }, +); +__PACKAGE__->belongs_to( + "itemnumber", + "C4::Schema::Result::Items", + { itemnumber => "itemnumber" }, +); +__PACKAGE__->belongs_to( + "branchcode", + "C4::Schema::Result::Branches", + { branchcode => "branchcode" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IowogHhaHJUcphZUUdCZDw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Reviews.pm b/C4/Schema/Result/Reviews.pm new file mode 100644 index 0000000..dc6852c --- /dev/null +++ b/C4/Schema/Result/Reviews.pm @@ -0,0 +1,42 @@ +package C4::Schema::Result::Reviews; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("reviews"); +__PACKAGE__->add_columns( + "reviewid", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "borrowernumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "biblionumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "review", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "approved", + { data_type => "TINYINT", default_value => undef, is_nullable => 1, size => 4 }, + "datereviewed", + { + data_type => "DATETIME", + default_value => undef, + is_nullable => 1, + size => 19, + }, +); +__PACKAGE__->set_primary_key("reviewid"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:p1Rqvi3RvCogNu85QWXhMQ + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Roadtype.pm b/C4/Schema/Result/Roadtype.pm new file mode 100644 index 0000000..1db4e62 --- /dev/null +++ b/C4/Schema/Result/Roadtype.pm @@ -0,0 +1,24 @@ +package C4::Schema::Result::Roadtype; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("roadtype"); +__PACKAGE__->add_columns( + "roadtypeid", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "road_type", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 100 }, +); +__PACKAGE__->set_primary_key("roadtypeid"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9veslaGcHZgVoq0+Zsp0rQ + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/SavedReports.pm b/C4/Schema/Result/SavedReports.pm new file mode 100644 index 0000000..7754510 --- /dev/null +++ b/C4/Schema/Result/SavedReports.pm @@ -0,0 +1,38 @@ +package C4::Schema::Result::SavedReports; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("saved_reports"); +__PACKAGE__->add_columns( + "id", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "report_id", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "report", + { + data_type => "LONGTEXT", + default_value => undef, + is_nullable => 1, + size => 4294967295, + }, + "date_run", + { + data_type => "DATETIME", + default_value => undef, + is_nullable => 1, + size => 19, + }, +); +__PACKAGE__->set_primary_key("id"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+HjQG3gNpPXkPVR6v591VQ + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/SavedSql.pm b/C4/Schema/Result/SavedSql.pm new file mode 100644 index 0000000..4997b32 --- /dev/null +++ b/C4/Schema/Result/SavedSql.pm @@ -0,0 +1,73 @@ +package C4::Schema::Result::SavedSql; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("saved_sql"); +__PACKAGE__->add_columns( + "id", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "borrowernumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "date_created", + { + data_type => "DATETIME", + default_value => undef, + is_nullable => 1, + size => 19, + }, + "last_modified", + { + data_type => "DATETIME", + default_value => undef, + is_nullable => 1, + size => 19, + }, + "savedsql", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "last_run", + { + data_type => "DATETIME", + default_value => undef, + is_nullable => 1, + size => 19, + }, + "report_name", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "type", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "notes", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, +); +__PACKAGE__->set_primary_key("id"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:W80NXti4OHMyFBv6+7IeYQ + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Serial.pm b/C4/Schema/Result/Serial.pm new file mode 100644 index 0000000..762a944 --- /dev/null +++ b/C4/Schema/Result/Serial.pm @@ -0,0 +1,62 @@ +package C4::Schema::Result::Serial; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("serial"); +__PACKAGE__->add_columns( + "serialid", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "biblionumber", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 100 }, + "subscriptionid", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 100 }, + "serialseq", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 100 }, + "status", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 4 }, + "planneddate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "notes", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "publisheddate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "itemnumber", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "claimdate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "routingnotes", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, +); +__PACKAGE__->set_primary_key("serialid"); +__PACKAGE__->has_many( + "serialitems", + "C4::Schema::Result::Serialitems", + { "foreign.serialid" => "self.serialid" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9LrgvITVygwpZ3745sqV4w + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Serialitems.pm b/C4/Schema/Result/Serialitems.pm new file mode 100644 index 0000000..bf04fd4 --- /dev/null +++ b/C4/Schema/Result/Serialitems.pm @@ -0,0 +1,29 @@ +package C4::Schema::Result::Serialitems; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("serialitems"); +__PACKAGE__->add_columns( + "itemnumber", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, + "serialid", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, +); +__PACKAGE__->add_unique_constraint("serialitemsidx", ["itemnumber"]); +__PACKAGE__->belongs_to( + "serialid", + "C4::Schema::Result::Serial", + { serialid => "serialid" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gKNGPUtrWDwv+xFVXHkcMw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/ServicesThrottle.pm b/C4/Schema/Result/ServicesThrottle.pm new file mode 100644 index 0000000..54f5f29 --- /dev/null +++ b/C4/Schema/Result/ServicesThrottle.pm @@ -0,0 +1,29 @@ +package C4::Schema::Result::ServicesThrottle; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("services_throttle"); +__PACKAGE__->add_columns( + "service_type", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "service_count", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 45, + }, +); +__PACKAGE__->set_primary_key("service_type"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4ARCf+9DkapK8pVDUcN5HA + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Sessions.pm b/C4/Schema/Result/Sessions.pm new file mode 100644 index 0000000..d3c4a71 --- /dev/null +++ b/C4/Schema/Result/Sessions.pm @@ -0,0 +1,24 @@ +package C4::Schema::Result::Sessions; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("sessions"); +__PACKAGE__->add_columns( + "id", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 32 }, + "a_session", + { data_type => "TEXT", default_value => "", is_nullable => 0, size => 65535 }, +); +__PACKAGE__->add_unique_constraint("id", ["id"]); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oaySLsjO1A+QTOUu8qadcA + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/SpecialHolidays.pm b/C4/Schema/Result/SpecialHolidays.pm new file mode 100644 index 0000000..46d3eca --- /dev/null +++ b/C4/Schema/Result/SpecialHolidays.pm @@ -0,0 +1,36 @@ +package C4::Schema::Result::SpecialHolidays; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("special_holidays"); +__PACKAGE__->add_columns( + "id", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "branchcode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "day", + { data_type => "SMALLINT", default_value => 0, is_nullable => 0, size => 6 }, + "month", + { data_type => "SMALLINT", default_value => 0, is_nullable => 0, size => 6 }, + "year", + { data_type => "SMALLINT", default_value => 0, is_nullable => 0, size => 6 }, + "isexception", + { data_type => "SMALLINT", default_value => 1, is_nullable => 0, size => 1 }, + "title", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 50 }, + "description", + { data_type => "TEXT", default_value => "", is_nullable => 0, size => 65535 }, +); +__PACKAGE__->set_primary_key("id"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nIF51IkyucgAWc6tyYlLMA + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Statistics.pm b/C4/Schema/Result/Statistics.pm new file mode 100644 index 0000000..c577977 --- /dev/null +++ b/C4/Schema/Result/Statistics.pm @@ -0,0 +1,71 @@ +package C4::Schema::Result::Statistics; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("statistics"); +__PACKAGE__->add_columns( + "datetime", + { + data_type => "DATETIME", + default_value => undef, + is_nullable => 1, + size => 19, + }, + "branch", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "proccode", + { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 4 }, + "value", + { data_type => "DOUBLE", default_value => undef, is_nullable => 1, size => 64 }, + "type", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 16, + }, + "other", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "usercode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "itemnumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "itemtype", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "borrowernumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "associatedborrower", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:54G0Kct8YFEuxBB5TtlVRw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Stopwords.pm b/C4/Schema/Result/Stopwords.pm new file mode 100644 index 0000000..0eb1e66 --- /dev/null +++ b/C4/Schema/Result/Stopwords.pm @@ -0,0 +1,26 @@ +package C4::Schema::Result::Stopwords; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("stopwords"); +__PACKAGE__->add_columns( + "word", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:w2cL5dckMrhYo9c0uKY+Kw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Subscription.pm b/C4/Schema/Result/Subscription.pm new file mode 100644 index 0000000..63d459e --- /dev/null +++ b/C4/Schema/Result/Subscription.pm @@ -0,0 +1,147 @@ +package C4::Schema::Result::Subscription; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("subscription"); +__PACKAGE__->add_columns( + "biblionumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "subscriptionid", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "librarian", + { data_type => "VARCHAR", default_value => "", is_nullable => 1, size => 100 }, + "startdate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "aqbooksellerid", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 11 }, + "cost", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 11 }, + "aqbudgetid", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 11 }, + "weeklength", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 11 }, + "monthlength", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 11 }, + "numberlength", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 11 }, + "periodicity", + { data_type => "TINYINT", default_value => 0, is_nullable => 1, size => 4 }, + "dow", + { data_type => "VARCHAR", default_value => "", is_nullable => 1, size => 100 }, + "numberingmethod", + { data_type => "VARCHAR", default_value => "", is_nullable => 1, size => 100 }, + "notes", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "status", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 100 }, + "add1", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 11 }, + "every1", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 11 }, + "whenmorethan1", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 11 }, + "setto1", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "lastvalue1", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "add2", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 11 }, + "every2", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 11 }, + "whenmorethan2", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 11 }, + "setto2", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "lastvalue2", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "add3", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 11 }, + "every3", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 11 }, + "innerloop1", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 11 }, + "innerloop2", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 11 }, + "innerloop3", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 11 }, + "whenmorethan3", + { data_type => "INT", default_value => 0, is_nullable => 1, size => 11 }, + "setto3", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "lastvalue3", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "issuesatonce", + { data_type => "TINYINT", default_value => 1, is_nullable => 0, size => 3 }, + "firstacquidate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "manualhistory", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 }, + "irregularity", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "letter", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 20, + }, + "numberpattern", + { data_type => "TINYINT", default_value => 0, is_nullable => 1, size => 3 }, + "distributedto", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "internalnotes", + { + data_type => "LONGTEXT", + default_value => undef, + is_nullable => 1, + size => 4294967295, + }, + "callnumber", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "branchcode", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "hemisphere", + { data_type => "TINYINT", default_value => 0, is_nullable => 1, size => 3 }, + "lastbranch", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "serialsadditems", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 1 }, +); +__PACKAGE__->set_primary_key("subscriptionid"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fHRa542DDKxlAIT5QEQU4Q + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Subscriptionhistory.pm b/C4/Schema/Result/Subscriptionhistory.pm new file mode 100644 index 0000000..42947e5 --- /dev/null +++ b/C4/Schema/Result/Subscriptionhistory.pm @@ -0,0 +1,46 @@ +package C4::Schema::Result::Subscriptionhistory; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("subscriptionhistory"); +__PACKAGE__->add_columns( + "biblionumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "subscriptionid", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "histstartdate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "enddate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "missinglist", + { + data_type => "LONGTEXT", + default_value => "", + is_nullable => 0, + size => 4294967295, + }, + "recievedlist", + { + data_type => "LONGTEXT", + default_value => "", + is_nullable => 0, + size => 4294967295, + }, + "opacnote", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 150 }, + "librariannote", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 150 }, +); +__PACKAGE__->set_primary_key("subscriptionid"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4JO3cccS7e7nn3vYH7NQ/Q + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Subscriptionroutinglist.pm b/C4/Schema/Result/Subscriptionroutinglist.pm new file mode 100644 index 0000000..2e2a818 --- /dev/null +++ b/C4/Schema/Result/Subscriptionroutinglist.pm @@ -0,0 +1,28 @@ +package C4::Schema::Result::Subscriptionroutinglist; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("subscriptionroutinglist"); +__PACKAGE__->add_columns( + "routingid", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "borrowernumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "ranking", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "subscriptionid", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, +); +__PACKAGE__->set_primary_key("routingid"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HBTj0bpaMzIl9Yx52qStwg + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Suggestions.pm b/C4/Schema/Result/Suggestions.pm new file mode 100644 index 0000000..2bb3df6 --- /dev/null +++ b/C4/Schema/Result/Suggestions.pm @@ -0,0 +1,104 @@ +package C4::Schema::Result::Suggestions; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("suggestions"); +__PACKAGE__->add_columns( + "suggestionid", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 8 }, + "suggestedby", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "managedby", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "status", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 10 }, + "note", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "author", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 80, + }, + "title", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 80, + }, + "copyrightdate", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "publishercode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "date", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, + "volumedesc", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "publicationyear", + { data_type => "SMALLINT", default_value => 0, is_nullable => 1, size => 6 }, + "place", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "isbn", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "mailoverseeing", + { data_type => "SMALLINT", default_value => 0, is_nullable => 1, size => 1 }, + "biblionumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "reason", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, +); +__PACKAGE__->set_primary_key("suggestionid"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Xv3RVybnEFFoml+RYIGieA + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Systempreferences.pm b/C4/Schema/Result/Systempreferences.pm new file mode 100644 index 0000000..3c8a2f6 --- /dev/null +++ b/C4/Schema/Result/Systempreferences.pm @@ -0,0 +1,50 @@ +package C4::Schema::Result::Systempreferences; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("systempreferences"); +__PACKAGE__->add_columns( + "variable", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 50 }, + "value", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "options", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "explanation", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "type", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 20, + }, +); +__PACKAGE__->set_primary_key("variable"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:R40Ul0Z671WE8zKX5f7uNw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Tags.pm b/C4/Schema/Result/Tags.pm new file mode 100644 index 0000000..d287a88 --- /dev/null +++ b/C4/Schema/Result/Tags.pm @@ -0,0 +1,24 @@ +package C4::Schema::Result::Tags; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("tags"); +__PACKAGE__->add_columns( + "entry", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 255 }, + "weight", + { data_type => "BIGINT", default_value => 0, is_nullable => 0, size => 20 }, +); +__PACKAGE__->set_primary_key("entry"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ecOM+vXRwmc1EsmQcKcRbw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/TagsAll.pm b/C4/Schema/Result/TagsAll.pm new file mode 100644 index 0000000..1b39e3b --- /dev/null +++ b/C4/Schema/Result/TagsAll.pm @@ -0,0 +1,42 @@ +package C4::Schema::Result::TagsAll; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("tags_all"); +__PACKAGE__->add_columns( + "tag_id", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "borrowernumber", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, + "biblionumber", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, + "term", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 255 }, + "language", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 4 }, + "date_created", + { data_type => "DATETIME", default_value => "", is_nullable => 0, size => 19 }, +); +__PACKAGE__->set_primary_key("tag_id"); +__PACKAGE__->belongs_to( + "borrowernumber", + "C4::Schema::Result::Borrowers", + { borrowernumber => "borrowernumber" }, +); +__PACKAGE__->belongs_to( + "biblionumber", + "C4::Schema::Result::Biblio", + { biblionumber => "biblionumber" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hWf2fDesvoq5Jmq1ugs53A + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/TagsApproval.pm b/C4/Schema/Result/TagsApproval.pm new file mode 100644 index 0000000..7254e95 --- /dev/null +++ b/C4/Schema/Result/TagsApproval.pm @@ -0,0 +1,45 @@ +package C4::Schema::Result::TagsApproval; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("tags_approval"); +__PACKAGE__->add_columns( + "term", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 255 }, + "approved", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 1 }, + "date_approved", + { + data_type => "DATETIME", + default_value => undef, + is_nullable => 1, + size => 19, + }, + "approved_by", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "weight_total", + { data_type => "INT", default_value => 1, is_nullable => 0, size => 9 }, +); +__PACKAGE__->set_primary_key("term"); +__PACKAGE__->belongs_to( + "approved_by", + "C4::Schema::Result::Borrowers", + { borrowernumber => "approved_by" }, +); +__PACKAGE__->has_many( + "tags_indexes", + "C4::Schema::Result::TagsIndex", + { "foreign.term" => "self.term" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:F+T3Ind6N8T3V+x7Z1BD/Q + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/TagsIndex.pm b/C4/Schema/Result/TagsIndex.pm new file mode 100644 index 0000000..bc91498 --- /dev/null +++ b/C4/Schema/Result/TagsIndex.pm @@ -0,0 +1,32 @@ +package C4::Schema::Result::TagsIndex; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("tags_index"); +__PACKAGE__->add_columns( + "term", + { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 255 }, + "biblionumber", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, + "weight", + { data_type => "INT", default_value => 1, is_nullable => 0, size => 9 }, +); +__PACKAGE__->set_primary_key("term", "biblionumber"); +__PACKAGE__->belongs_to("term", "C4::Schema::Result::TagsApproval", { term => "term" }); +__PACKAGE__->belongs_to( + "biblionumber", + "C4::Schema::Result::Biblio", + { biblionumber => "biblionumber" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zhwCgLazWF3UUB4rwdGduQ + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/TmpHoldsqueue.pm b/C4/Schema/Result/TmpHoldsqueue.pm new file mode 100644 index 0000000..4a027e5 --- /dev/null +++ b/C4/Schema/Result/TmpHoldsqueue.pm @@ -0,0 +1,99 @@ +package C4::Schema::Result::TmpHoldsqueue; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("tmp_holdsqueue"); +__PACKAGE__->add_columns( + "biblionumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "itemnumber", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "barcode", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 20, + }, + "surname", + { + data_type => "MEDIUMTEXT", + default_value => "", + is_nullable => 0, + size => 16777215, + }, + "firstname", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "phone", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "borrowernumber", + { data_type => "INT", default_value => "", is_nullable => 0, size => 11 }, + "cardnumber", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 16, + }, + "reservedate", + { data_type => "DATE", default_value => undef, is_nullable => 1, size => 10 }, + "title", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "itemcallnumber", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 30, + }, + "holdingbranch", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "pickbranch", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 10, + }, + "notes", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "item_level_request", + { data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 4 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GmqBQqOqso8QhqeORrLeCw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/UserPermissions.pm b/C4/Schema/Result/UserPermissions.pm new file mode 100644 index 0000000..c1d524c --- /dev/null +++ b/C4/Schema/Result/UserPermissions.pm @@ -0,0 +1,40 @@ +package C4::Schema::Result::UserPermissions; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("user_permissions"); +__PACKAGE__->add_columns( + "borrowernumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "module_bit", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "code", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 30, + }, +); +__PACKAGE__->belongs_to( + "borrowernumber", + "C4::Schema::Result::Borrowers", + { borrowernumber => "borrowernumber" }, +); +__PACKAGE__->belongs_to( + "permission", + "C4::Schema::Result::Permissions", + { code => "code", module_bit => "module_bit" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ueX1wVaxJQv+jvlay0OxqA + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Userflags.pm b/C4/Schema/Result/Userflags.pm new file mode 100644 index 0000000..785a849 --- /dev/null +++ b/C4/Schema/Result/Userflags.pm @@ -0,0 +1,43 @@ +package C4::Schema::Result::Userflags; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("userflags"); +__PACKAGE__->add_columns( + "bit", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "flag", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 30, + }, + "flagdesc", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "defaulton", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, +); +__PACKAGE__->set_primary_key("bit"); +__PACKAGE__->has_many( + "permissions", + "C4::Schema::Result::Permissions", + { "foreign.module_bit" => "self.bit" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZqsaYcaaKIUUHKQzoRMxyA + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Virtualshelfcontents.pm b/C4/Schema/Result/Virtualshelfcontents.pm new file mode 100644 index 0000000..c610dc6 --- /dev/null +++ b/C4/Schema/Result/Virtualshelfcontents.pm @@ -0,0 +1,42 @@ +package C4::Schema::Result::Virtualshelfcontents; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("virtualshelfcontents"); +__PACKAGE__->add_columns( + "shelfnumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "biblionumber", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "flags", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "dateadded", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, +); +__PACKAGE__->belongs_to( + "biblionumber", + "C4::Schema::Result::Biblio", + { biblionumber => "biblionumber" }, +); +__PACKAGE__->belongs_to( + "shelfnumber", + "C4::Schema::Result::Virtualshelves", + { shelfnumber => "shelfnumber" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:eZFGy3gZoYHfK6P9C0ChcQ + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Virtualshelves.pm b/C4/Schema/Result/Virtualshelves.pm new file mode 100644 index 0000000..33c3c76 --- /dev/null +++ b/C4/Schema/Result/Virtualshelves.pm @@ -0,0 +1,57 @@ +package C4::Schema::Result::Virtualshelves; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("virtualshelves"); +__PACKAGE__->add_columns( + "shelfnumber", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "shelfname", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "owner", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 80, + }, + "category", + { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 1 }, + "sortfield", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 16, + }, + "lastmodified", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, +); +__PACKAGE__->set_primary_key("shelfnumber"); +__PACKAGE__->has_many( + "virtualshelfcontents", + "C4::Schema::Result::Virtualshelfcontents", + { "foreign.shelfnumber" => "self.shelfnumber" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:S3kuH2190vR/AoVGT88Hmg + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Z3950servers.pm b/C4/Schema/Result/Z3950servers.pm new file mode 100644 index 0000000..a3d9554 --- /dev/null +++ b/C4/Schema/Result/Z3950servers.pm @@ -0,0 +1,100 @@ +package C4::Schema::Result::Z3950servers; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("z3950servers"); +__PACKAGE__->add_columns( + "host", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "port", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "db", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "userid", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "password", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 255, + }, + "name", + { + data_type => "MEDIUMTEXT", + default_value => undef, + is_nullable => 1, + size => 16777215, + }, + "id", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "checked", + { + data_type => "SMALLINT", + default_value => undef, + is_nullable => 1, + size => 6, + }, + "rank", + { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 }, + "syntax", + { + data_type => "VARCHAR", + default_value => undef, + is_nullable => 1, + size => 80, + }, + "icon", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "position", + { + data_type => "ENUM", + default_value => "primary", + is_nullable => 0, + size => 9, + }, + "type", + { data_type => "ENUM", default_value => "zed", is_nullable => 0, size => 10 }, + "encoding", + { + data_type => "TEXT", + default_value => undef, + is_nullable => 1, + size => 65535, + }, + "description", + { data_type => "TEXT", default_value => "", is_nullable => 0, size => 65535 }, +); +__PACKAGE__->set_primary_key("id"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:EY7k6nTL3g0OcZ1D89iFuA + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; diff --git a/C4/Schema/Result/Zebraqueue.pm b/C4/Schema/Result/Zebraqueue.pm new file mode 100644 index 0000000..516e077 --- /dev/null +++ b/C4/Schema/Result/Zebraqueue.pm @@ -0,0 +1,37 @@ +package C4::Schema::Result::Zebraqueue; + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Core"); +__PACKAGE__->table("zebraqueue"); +__PACKAGE__->add_columns( + "id", + { data_type => "INT", default_value => undef, is_nullable => 0, size => 11 }, + "biblio_auth_number", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "operation", + { data_type => "CHAR", default_value => "", is_nullable => 0, size => 20 }, + "server", + { data_type => "CHAR", default_value => "", is_nullable => 0, size => 20 }, + "done", + { data_type => "INT", default_value => 0, is_nullable => 0, size => 11 }, + "time", + { + data_type => "TIMESTAMP", + default_value => "CURRENT_TIMESTAMP", + is_nullable => 0, + size => 14, + }, +); +__PACKAGE__->set_primary_key("id"); + + +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-10-31 14:23:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mT57Ss62IDTdSsjbnofUpw + + +# You can replace this text with custom content, and it will be preserved on regeneration +1; -- 1.5.6
This is an example of replacing the SQL calls in the first half of the C4/ClassSource.pm file with calls to the DBIx::Class schema object. I used this module as an example because it's rather simple and you can see how the more simple SQL operations can get replaced by calls to the schema object. I've included some test files that pass both before and after the changes. I'm hopeful that they demonstrate that the functionality hasn't changed. --- C4/ClassSource.pm | 66 ++++++++++++---------------- t/lib/KohaTest/ClassSource.pm | 34 +++++++++++++++ t/lib/KohaTest/ClassSource/ClassSource.pm | 56 ++++++++++++++++++++++++ 3 files changed, 118 insertions(+), 38 deletions(-) create mode 100644 t/lib/KohaTest/ClassSource.pm create mode 100644 t/lib/KohaTest/ClassSource/ClassSource.pm diff --git a/C4/ClassSource.pm b/C4/ClassSource.pm index 4a161ae..4db0656 100644 --- a/C4/ClassSource.pm +++ b/C4/ClassSource.pm @@ -64,6 +64,9 @@ sources and sorting rules. ); +use C4::Schema; +our $schema = C4::Schema->connect(); + =head2 GetClassSources my $sources = GetClassSources(); @@ -91,13 +94,11 @@ foreach my $cn_source (sort keys %$sources) { sub GetClassSources { my %class_sources = (); - my $dbh = C4::Context->dbh; - my $sth = $dbh->prepare_cached("SELECT * FROM `class_sources`"); - $sth->execute(); - while (my $source = $sth->fetchrow_hashref) { - $class_sources{ $source->{'cn_source'} } = $source; + + my @class_sources = $schema->resultset('ClassSources')->search(); + foreach my $row ( @class_sources ) { + $class_sources{ $row->get_column('cn_source') } = { $row->get_columns }; } - $sth->finish(); return \%class_sources; @@ -112,15 +113,14 @@ sub GetClassSources { =cut sub AddClassSource { - - my ($cn_source, $description, $used, $class_sort_rule) = @_; - my $dbh = C4::Context->dbh; - my $sth = $dbh->prepare_cached("INSERT INTO `class_sources` - (`cn_source`, `description`, `used`, `class_sort_rule`) - VALUES (?, ?, ?, ?)"); - $sth->execute($cn_source, $description, $used, $class_sort_rule); - $sth->finish(); - + my ( $cn_source, $description, $used, $class_sort_rule ) = @_; + my $new_cs = $schema->resultset('ClassSources')->create( + { cn_source => $cn_source, + description => $description, + used => $used, + class_sort_rule => $class_sort_rule + } + ); } =head2 GetClassSource @@ -132,14 +132,12 @@ sub AddClassSource { =cut sub GetClassSource { + my $cn_source = shift; - my ($cn_source) = (@_); - my $dbh = C4::Context->dbh; - my $sth = $dbh->prepare_cached("SELECT * FROM `class_sources` WHERE cn_source = ?"); - $sth->execute($cn_source); - my $row = $sth->fetchrow_hashref(); - $sth->finish(); - return $row; + my $rs = $schema->resultset('ClassSources')->find( $cn_source ); + return unless defined $rs; # in case this one doesn't exist. + my %class_source = $rs->get_columns; + return \%class_source; } =head2 ModClassSource @@ -151,17 +149,14 @@ sub GetClassSource { =cut sub ModClassSource { - my ($cn_source, $description, $used, $class_sort_rule) = @_; - my $dbh = C4::Context->dbh; - my $sth = $dbh->prepare_cached("UPDATE `class_sources` - SET `description` = ?, - `used` = ?, - `class_sort_rule` = ? - WHERE `cn_source` = ?"); - $sth->execute($description, $used, $class_sort_rule, $cn_source); - $sth->finish(); + my $cs = $schema->resultset('ClassSources')->find( $cn_source ); + return unless defined $cs; # in case this one doesn't exist. + $cs->set_column( description => $description ); + $cs->set_column( used => $used ); + $cs->set_column( class_sort_rule => $class_sort_rule ); + return $cs->update(); } =head2 DelClassSource @@ -173,13 +168,8 @@ sub ModClassSource { =cut sub DelClassSource { - - my ($cn_source) = @_; - my $dbh = C4::Context->dbh; - my $sth = $dbh->prepare_cached("DELETE FROM `class_sources` WHERE `cn_source` = ?"); - $sth->execute($cn_source); - $sth->finish(); - + my $cn_source = shift; + my $deleted = $schema->resultset('ClassSources')->find( $cn_source )->delete; } =head2 GetClassSortRules diff --git a/t/lib/KohaTest/ClassSource.pm b/t/lib/KohaTest/ClassSource.pm new file mode 100644 index 0000000..227272b --- /dev/null +++ b/t/lib/KohaTest/ClassSource.pm @@ -0,0 +1,34 @@ +package KohaTest::ClassSource; +use base qw( KohaTest ); + +use strict; +use warnings; + +use Test::More; + +use C4::Members; +sub testing_class { 'C4::ClassSource' }; + + +sub methods : Test( 1 ) { + my $self = shift; + my @methods = qw( + GetClassSources + AddClassSource + GetClassSource + ModClassSource + DelClassSource + GetClassSortRules + AddClassSortRule + GetClassSortRule + ModClassSortRule + DelClassSortRule + GetSourcesForSortRule + GetClassSort + ); + + can_ok( $self->testing_class, @methods ); +} + +1; + diff --git a/t/lib/KohaTest/ClassSource/ClassSource.pm b/t/lib/KohaTest/ClassSource/ClassSource.pm new file mode 100644 index 0000000..e15638c --- /dev/null +++ b/t/lib/KohaTest/ClassSource/ClassSource.pm @@ -0,0 +1,56 @@ +package KohaTest::ClassSource::ClassSource; +use base qw( KohaTest::ClassSource ); + +use strict; +use warnings; + +use Test::More; + +use C4::ClassSource; + +sub round_trip : Test(8) { + my $self = shift; + + my $example = { + cn_source => 'foo', + class_sort_rule => 'generic', + used => '0', + description => 'example for testing' + }; + + my $not_there = GetClassSource( $example->{'cn_source'} ); + ok( ! defined( $not_there ), 'our example is not there to start with' ) or + warn( Data::Dumper->Dump( [ $not_there ], [ 'not_there' ] ) ); + + my $added = AddClassSource( $example->{'cn_source'}, $example->{'description'}, $example->{'used'}, $example->{'class_sort_rule'} ); + ok( $added, 'added' ); + + my $there = GetClassSource( $example->{'cn_source'} ); + is_deeply( $there, $example, 'the one we got back is the same as the one we sent in' ); + + my $class_sources = GetClassSources(); + is_deeply( $class_sources->{ $example->{'cn_source'} }, $example ) + or warn( Data::Dumper->Dump( [ $class_sources ], [ 'class_sources' ] ) ); + + my $modified_example = { + cn_source => $example->{'cn_source'}, + class_sort_rule => 'dewey', + used => '1', + description => 'modified example for testing', + }; + + my $modified = ModClassSource( $modified_example->{'cn_source'}, $modified_example->{'description'}, $modified_example->{'used'}, $modified_example->{'class_sort_rule'} ); + ok( $modified, 'modified' ); + + my $found_modified = GetClassSource( $modified_example->{'cn_source'} ); + is_deeply( $found_modified, $modified_example, 'the one we got back is the same as the one we sent in' ); + + my $deleted = DelClassSource( $modified_example->{'cn_source'} ); + ok( $deleted, 'deleted' ); + + my $not_found = GetClassSource( $modified_example->{'cn_source'} ); + ok( ! defined( $not_found ), 'deleted' ); + +} + +1; -- 1.5.6
Here are some changes that can be made to the C4::Members class to start moving away from writing our own SQL and towards using the C4::Schema object built with DBIx::Class. Though I haven't replaced many methods in this class, I'm chosing this one because it's more complex than the C4::ClassSource example and may show some more aspects of my proposed change. --- C4/Members.pm | 25 +++++++++++-------------- 1 files changed, 11 insertions(+), 14 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index e756ffb..c9cbd0d 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -108,6 +108,9 @@ BEGIN { ); } +use C4::Schema; +our $schema = C4::Schema->connect(); + =head1 NAME C4::Members - Perl Module containing convenience functions for member handling @@ -592,7 +595,7 @@ sub GetMemberIssuesAndFines { } sub columns(;$) { - return @{C4::Context->dbh->selectcol_arrayref("SHOW columns from borrowers")}; + return $schema->source('Borrowers')->columns; } =head2 @@ -633,9 +636,9 @@ sub ModMember { } my @columns = &columns; my %hashborrowerfields = (map {$_=>1} @columns); - my $query = "UPDATE borrowers SET \n"; - my $sth; - my @parameters; + + my $borrower = $schema->resultset('Borrowers')->find( $data{'borrowernumber'} ); + return unless $borrower; # that member must not exist. # test to know if you must update or not the borrower password if (exists $data{password}) { @@ -649,21 +652,15 @@ sub ModMember { foreach (keys %data) { next if ($_ eq 'borrowernumber' or $_ eq 'flags'); if ($hashborrowerfields{$_}){ - $query .= " $_=?, "; - push @parameters,$data{$_}; + $borrower->set_column( $_, $data{$_} ); } else { push @badkeys, $_; delete $data{$_}; } } (@badkeys) and warn scalar(@badkeys) . " Illegal key(s) passed to ModMember: " . join(',',@badkeys); - $query =~ s/, $//; - $query .= " WHERE borrowernumber=?"; - push @parameters, $data{'borrowernumber'}; - $debug and print STDERR "$query (executed w/ arg: $data{'borrowernumber'})"; - $sth = $dbh->prepare($query); - my $execute_success = $sth->execute(@parameters); - $sth->finish; + $debug and print STDERR "updating borrower: $data{'borrowernumber'}"; + my $execute_success = $borrower->update(); # ok if its an adult (type) it may have borrowers that depend on it as a guarantor # so when we update information for an adult we should check for guarantees and update the relevant part @@ -673,7 +670,7 @@ sub ModMember { # is adult check guarantees; UpdateGuarantees(%data); } - logaction("MEMBERS", "MODIFY", $data{'borrowernumber'}, "$query (executed w/ arg: $data{'borrowernumber'})") + logaction("MEMBERS", "MODIFY", $data{'borrowernumber'}, "modified borrower: $data{'borrowernumber'}") if C4::Context->preference("BorrowersLog"); return $execute_success; -- 1.5.6
Hi andrew. Thanks for your hard work. I will try and test this. I hope that Marc will have some time to this too. let's stay tuned. -- Henri-Damien LAURENT
I finally found the time to play around with this over the past few days, and I very much hope that others make the time to do so. The first module that I tried to look at was Serials.pm, since I did some work on it relatively recently. What I found immediately is that none of the relations were auto-discovered by the schema generator. I am guessing that this reveals a lack of fk defs in our base schema in this module. While this may seem like a real pain, and seem to raise the bar, so to speak, in terms of the amount of effort required to adopt an ORM, I think that investing the time now in firming up and fixing Koha's base schema will be well worth it in the long term. One of the things I really like about what I've seen in DBIx::Class is that once you define the relationships properly in your schema object, getting at the data you want becomes pretty easy. Joins are handled for you by the abstraction layer itself. This will only work if some of the shortcomings of Koha's core schema are addressed, however. If they aren't, then we'll end up passing all sorts of modifiers to our Schema objects in order to compensate, in which case we may as well just be writing SQL. So my feeling is that the power and advantage of DBIx::Class can only be taken advantage of if some of our problematic db schema issues are addressed as a part of this work. Once this is addressed, I think this will really clean up core Koha modules, and allow the RDBMS to take care of the things that it's good at taking care of, and give us code simplification and multi-db support at once. In short, I'm highly in favor of pursuing this, with the caveat that we have a bit of cleanup to do in the process. An interesting line of thought is whether one might approach this 'cleanup' (i.e. properly defining pks, fks & table relations) from the POV of the db schema itself, or from the POV of the db abstraction layer. Obviously, it's harder to do it from the abstraction layer for an extant schema, but it can be approached from either direction. I hope that others get a chance to apply these patches and offer some feedback. I'd like to see this implemented. Regards, Ryan On Sat, Nov 1, 2008 at 3:53 AM, Henri-Damien LAURENT <laurenthdl@alinto.com>wrote:
Hi andrew. Thanks for your hard work. I will try and test this. I hope that Marc will have some time to this too. let's stay tuned. -- Henri-Damien LAURENT _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha.org http://lists.koha.org/mailman/listinfo/koha-devel
-- Ryan Higgins LibLime * Open-Source Solutions for Libraries Featuring KohaZOOM ILS 888-564-2457 x704
Ryan Higgins wrote:
I am guessing that this reveals a lack of fk defs in our base schema in this module. While this may seem like a real pain, and seem to raise the bar, so to speak, in terms of the amount of effort required to adopt an ORM, I think that investing the time now in firming up and fixing Koha's base schema will be well worth it in the long term.
Definitely agree 100% with that. Excellent idea.
In short, I'm highly in favor of pursuing this, with the caveat that we have a bit of cleanup to do in the process. An interesting line of thought is whether one might approach this 'cleanup' (i.e. properly defining pks, fks & table relations) from the POV of the db schema itself, or from the POV of the db abstraction layer. Obviously, it's harder to do it from the abstraction layer for an extant schema, but it can be approached from either direction.
The database itself should be cleaned up. One reason for this is it is always best to define as much of the data model in the database itself so that the DB server can report back any errors it encounters when your try to update records or delete them. Another good reason is speed: it is far more efficient and quicker for the database to get things right than to leave data and relationship integrity to be checked in the application. When time permits, I want to take my "tutorial" approach and write a simple example or two using existing Koha data. I think we will want to put a thin abstraction layer on top of the somewhat clunky DBIx::Class interface to make it easier and more foolproof to handle data model objects in the Koha application. After all, many eyes, now and in the future, will be reading and maintaining Koha code. We are after people efficiency, not machine efficiency. The clearer and more concise the interface to the Koha data model, the better we have done our job. That said, I believe that the RFC relating to this should contain an analysis and design section that clearly lays out how we are going to use DBIx::Class (since there will be more than one way to do it) and perhaps document our "thin abstraction" layer if that is agreed to be the way to go. Oh .. where are these RFCs and how may I contribute? cheers rickw -- ________________________________________________________________ Rick Welykochy || Praxis Services || Internet Driving Instructor When the power of love overcomes the love of power, the world will know peace. -- Jimi Hendrix
Rick Welykochy a écrit :
Ryan Higgins wrote:
I am guessing that this reveals a lack of fk defs in our base schema in this module. While this may seem like a real pain, and seem to raise the bar, so to speak, in terms of the amount of effort required to adopt an ORM, I think that investing the time now in firming up and fixing Koha's base schema will be well worth it in the long term.
Definitely agree 100% with that. Excellent idea. I fully agree as well.
<mode history ON> when Koha has started (v1), it was on mySQL 3.23 (iirc), that handled only myISAM and no fk (well, iirc, that was possible to define FK in 3.23 or just after, but the FK was not handled by mySQL. It was just considered as SQL valid) I tried to add as many FK as possible in update22to30.pl, but for sure, I forgot some. <mode history OFF>
Another good reason is speed: it is far more efficient and quicker for the database to get things right than to leave data and relationship integrity to be checked in the application.
one thing that is a real shame is that, atm, if something fails due to FK constraint, the user is NOT warned that something was wrong. he just sees that the data has not be saved. That's really bad ! -- Paul POULAIN http://www.biblibre.com Expert en Logiciels Libres pour l'info-doc NOUVEAU TELEPHONE : 04 91 81 35 08
Paul POULAIN wrote:
one thing that is a real shame is that, atm, if something fails due to FK constraint, the user is NOT warned that something was wrong. he just sees that the data has not be saved. That's really bad !
The INNODB driver for MySQL reports an error if the FK doesn't exist at creation time. If by "user" you mean the database client, then yes, there is an error message: ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails If by "user" you are referring to the librarian or Koha user, then it is up to the Koha application to intercept and process the above error if it does happen and take remedial action, i.e. send an indignant email to Koha-dev! Given that you *cannot* create invalid FK relationships in the database, I don't see how anything could fail using FK constraints. They are a Good Thing (tm) and are required to avoid orphaned child records amongst many other things. cheers rickw -- ________________________________________________________________ Rick Welykochy || Praxis Services || Internet Driving Instructor When the power of love overcomes the love of power, the world will know peace. -- Jimi Hendrix
Hi, On Thu, Nov 13, 2008 at 3:06 AM, Rick Welykochy <rick@praxis.com.au> wrote:
Paul POULAIN wrote:
one thing that is a real shame is that, atm, if something fails due to FK constraint, the user is NOT warned that something was wrong. he just sees that the data has not be saved. That's really bad !
The INNODB driver for MySQL reports an error if the FK doesn't exist at creation time.
If by "user" you mean the database client, then yes, there is an error message:
ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails
If by "user" you are referring to the librarian or Koha user, then it is up to the Koha application to intercept and process the above error if it does happen and take remedial action, i.e. send an indignant email to Koha-dev!
I think the point is that by and large, Koha doesn't intercept FK violation errors and do something sensible with them. This needs to be improved, though I must admit that I smiled at the image of having such errors automatically forwarded to koha-devel. Regards, Galen -- Galen Charlton VP, Research & Development, LibLime galen.charlton@liblime.com p: 1-888-564-2457 x709 skype: gmcharlt
Rick Welykochy a écrit :
Paul POULAIN wrote: If by "user" you are referring to the librarian or Koha user, then it is up to the Koha application to intercept and process the above error if it does happen and take remedial action, i.e. send an indignant email to Koha-dev!
Given that you *cannot* create invalid FK relationships in the database, I don't see how anything could fail using FK constraints. They are a Good Thing (tm) and are required to avoid orphaned child records amongst many other things.
I know what is a FK done for, Rick (and in fact I'm the author of most of the FK in the DB atm ;-) ) What is a shame is that the librarian can enter something, enter "OK", and ... see nothing ... the value hasn't be added due to a FK error, and nothing on the browser : everything seems OK ! Quite annoying for the librarian ! We can't ask the librarian to look in error.log ! So we need to display something on the browser, like "Oups, something goes wrong. Ask the Koha team and specify the following problem : "FK contraint at xxxxx.pm, line YYY, koha version X.XX.XX.XXX" " Fortunatly, those errors are very uncommon, and I think I've seen them occuring only when a part of the DB has been entered through SQL insert & not the browser. But we should trap that anyway ! (as we should trap any SQL error) -- Paul POULAIN http://www.biblibre.com Expert en Logiciels Libres pour l'info-doc NOUVEAU TELEPHONE : 04 91 81 35 08
Paul POULAIN wrote:
What is a shame is that the librarian can enter something, enter "OK", and ... see nothing ... the value hasn't be added due to a FK error, and nothing on the browser : everything seems OK ! Quite annoying for the librarian !
Her is why: C4::Context creates the database connection as follows: my $dbh= DBI->connect("DBI:$db_driver:dbname=$db_name;host=$db_host;port=$db_port", $db_user, $db_passwd) What is missing is the options arg: { RaiseError => 1} V. important!
We can't ask the librarian to look in error.log ! So we need to display something on the browser, like "Oups, something goes wrong. Ask the Koha team and specify the following problem : "FK contraint at xxxxx.pm, line YYY, koha version X.XX.XX.XXX" "
Fortunatly, those errors are very uncommon, and I think I've seen them occuring only when a part of the DB has been entered through SQL insert & not the browser. But we should trap that anyway ! (as we should trap any SQL error)
This all relates to the application architecture. Is error handling to be done by checking error codes and responding accordingly, or are exceptions to be used? BTW: We should trap *any* error. cheers rickw -- _________________________________ Rick Welykochy || Praxis Services Censorship is telling a man he can't have a steak just because a baby can't chew it. -- Attributed to Mark Twain
On Tue, Nov 11, 2008 at 10:24 PM, Rick Welykochy <rick@praxis.com.au> wrote:
Oh .. where are these RFCs and how may I contribute?
So far, they have consisted only of these emails I've been sending out from git. They contain a "0" patch that contains no code, but just documentation. Then the patches show the creation of the C4::Schema object and a few examples of how we could use it. Now that it is looking more likely that this project is viable, perhaps I need to start a wiki page for it and capture some of these ideas and concerns in a little more permanent fashion. I only have time to work on this type of project on Fridays, so look for that this Friday. Feel free to start it or add to it if you would like. Thanks for your help, -Andy
Andrew Moore a écrit :
So far, they have consisted only of these emails I've been sending out from git. They contain a "0" patch that contains no code, but just documentation. Then the patches show the creation of the C4::Schema object and a few examples of how we could use it.
Now that it is looking more likely that this project is viable, perhaps I need to start a wiki page for it and capture some of these ideas and concerns in a little more permanent fashion. I only have time to work on this type of project on Fridays, so look for that this Friday. Feel free to start it or add to it if you would like.
Thanks for your help, -Andy
Hi you are doing a great job documenting and investigating. Thank you. I still had no time investigating or testing. But I am very glad of such a plan to get an ORM in Koha. Looking at the page you link to on wiki in terms of performances, I can see that RDBO seems to be a quicker ORM than DBIC. And we already have some performance issue on Circulation. Have you considered this alternate ORM which I have come across only some days ago ? Or will we have to use DBI, which is still 8 times faster (according to the tests http://code.google.com/p/rose/wiki/RDBOBenchmarksWithDBI ) than DBIC for circulation which is a critical part in Koha ? I donot want to slow down things. But I want to be sure that what we choose is the best alternative to fit our requirements. -- Henri-Damien LAURENT
Andrew Moore a écrit :
So far, they have consisted only of these emails I've been sending out from git. They contain a "0" patch that contains no code, but just documentation. Then the patches show the creation of the C4::Schema object and a few examples of how we could use it.
Now that it is looking more likely that this project is viable, perhaps I need to start a wiki page for it and capture some of these ideas and concerns in a little more permanent fashion. I only have time to work on this type of project on Fridays, so look for that this Friday. Feel free to start it or add to it if you would like.
Thanks for your help, -Andy
Hi you are doing a great job documenting and investigating. Thank you. I still had no time investigating or testing. But I am very glad of such a plan to get an ORM in Koha.
Looking at the page you link to on wiki in terms of performances, I can see that RDBO seems to be a quicker ORM than DBIC. And we already have some performance issue on Circulation. Have you considered this alternate ORM which I have come across only some days ago ? Or will we have to use DBI, which is still 8 times faster (according to the tests http://code.google.com/p/rose/wiki/RDBOBenchmarksWithDBI ) than DBIC for circulation which is a critical part in Koha ?
I donot want to slow down things. But I want to be sure that what we choose is the best alternative to fit our requirements. Speed is definitely a major concern here ... and I believe it's one of
On Sat, Nov 22, 2008 at 2:04 AM, Henri-Damien LAURENT <laurenthdl@alinto.com> wrote: the reasons that Koha originally wasn't written with an ORM. Andy, any thoughts about what this choice will mean w/respect to performance? Cheers, -- Joshua Ferraro SUPPORT FOR OPEN-SOURCE SOFTWARE CEO migration, training, maintenance, support LibLime Featuring Koha Open-Source ILS jmf@liblime.com |Full Demos at http://liblime.com/koha |1(888)KohaILS
I donot want to slow down things. But I want to be sure that what we choose is the best alternative to fit our requirements. Speed is definitely a major concern here ... and I believe it's one of the reasons that Koha originally wasn't written with an ORM. Andy, any thoughts about what this choice will mean w/respect to performance?
Yes, this is a concern. Ive just spent a bunch of time removing an ORM from an application due to performance and inflexibility issues. It was for a different kind of application, where everything has to be fast, with Koha, there are areas that definitely have to be faster than others. We might have to do some testing/profiling to make sure that we at best speed them up at worst don't make them any slower. Chris
On Sat, Nov 22, 2008 at 12:16 PM, Chris Cormack <chris@bigballofwax.co.nz> wrote:
I donot want to slow down things. But I want to be sure that what we choose is the best alternative to fit our requirements. Speed is definitely a major concern here ... and I believe it's one of the reasons that Koha originally wasn't written with an ORM. Andy, any thoughts about what this choice will mean w/respect to performance?
Yes, this is a concern. Ive just spent a bunch of time removing an ORM from an application due to performance and inflexibility issues. It was for a different kind of application, where everything has to be fast, with Koha, there are areas that definitely have to be faster than others. We might have to do some testing/profiling to make sure that we at best speed them up at worst don't make them any slower.
Hey Chris - That's surprising to me. I think that's the only example I've heard of that. What tools did you use to compare the performance under the ORM and without it? I've been researching making that comparison and I haven't come up with a good set of tools. I'd love to get some advice from you about this at some point. I'll keep an eye out for you on IRC. Thanks! -Andy
Joshua Ferraro wrote:
Speed is definitely a major concern here ... and I believe it's one of the reasons that Koha originally wasn't written with an ORM. Andy, any thoughts about what this choice will mean w/respect to performance?
The use of mod_perl would speed things up by an order (and a half) of magnitude, giving the software more leeway to use abstractions like an OR mapper. cheers rickw -- _________________________________ Rick Welykochy || Praxis Services Tis the dream of each programmer before his life is done, To write three lines of APL and make the damn thing run.
On Sat, Nov 22, 2008 at 1:04 AM, Henri-Damien LAURENT <laurenthdl@alinto.com> wrote:
Hi you are doing a great job documenting and investigating. Thank you. I still had no time investigating or testing. But I am very glad of such a plan to get an ORM in Koha.
Looking at the page you link to on wiki in terms of performances, I can see that RDBO seems to be a quicker ORM than DBIC. And we already have some performance issue on Circulation. Have you considered this alternate ORM which I have come across only some days ago ?
Hi Henri - Thanks for your encouragement. I am aware of Rose::DB::Object, but only looked at it briefly. One consideration I used was the comparison of several methods at: http://www.perlmonks.org/?node_id=700283 I feel that DBIx::Class is much better known and more actively developed, so perhaps that's why I focused mainly on it. I also would like to eventually replace our somewhat cumbersome updatedatabase.pl and kohastructure.sql method of maintaining database structure, and DBIx::Class seems to offer a reasonable way to do this through their DBIx::Class::Schema::Versioned module and associated practices. I would be happy to have any ORM in Koha since I believe it will make development much easier. If an example implementation of Koha using Rose::DB::Object were produced, I'd love to take a look at it and compare it to either using DBI or DBIx::Class.
Or will we have to use DBI, which is still 8 times faster (according to the tests http://code.google.com/p/rose/wiki/RDBOBenchmarksWithDBI ) than DBIC for circulation which is a critical part in Koha ?
It's possible that we could continue to use direct access to DBI in some spots where performance seems to be a problem spot, but I also think that we can improve performance a greater amount with some other changes. For instance, removing default searches on the unindexed borrowers.firstname field, or recommending the use of mod_perl or memcached. My current plan is to write enough code using DBIx::Class so that I can benchmark compare koha versions using DBI and DBIx::Class. I'm hopeful that this will give us some idea of the performance impact of the potential change. I expect this progress to be rather slow, but I'll keep updating the wiki page: <http://wiki.koha.org/doku.php?id=en:development:rfcs3.2:dbix-class>. Thanks, -Andy
On Wed, Oct 15, 2008 at 03:28:12PM +0200, Marc Chantreux wrote:
hello guys,
I just rewritten the C4::Bookseller::AddBookseller and it now looks like:
sub AddBookseller { _koha_insert_and_get_id( 'aqbooksellers', shift ); }
_koha_insert_and_get_id is a function where i deal with DBI and all specific DBD tricks with reuse in mind. You can see the following code.
do i try to push it in koha ? and where ? It sounds like Koha::SQL package.
hello, Few month ago, i posted a patch to begin to add a minimalistic sql query helper in koha. Ryan Higgins comes with le idea to use DBIx::Class which with i'm agree from the first day i read koha code: i shut up and read the thread. Now months have passed, there is no such things as DBIx code in the tree, i still wants to refactor some parts of the code i have to read/hack and came back to my first idea. My reflection about it: DBIx::Class adds an OO model in the heart of koha and there is no doubt that it can be a seriouse help to clean the code, add design rules and so on ... in the other way, i think that if we do that now, we'll loose a lot of gains the OO model can give to us because we don't make choices. - choose of an OO framework ( Class::Std, Moose, ...) ... or not: use the OO syntax as explained in the perl man. - choose of an ORM ( Jifty::DBI, DBIx::Class, ... ) ... or not: - http://dave.org.uk/talks/lpm/2006/orm/ - http://kore-nordmann.de/blog/why_active_record_sucks.html - .... - choose an MVC framework to jump into: i think one of the way we have to follow is the transplantation of an MVC framework as a new heart for koha. After a long reflection, i cames clear to me that we cannot just use a butcher knife and some pegs to do it. If we decide to do it, if we choose one of these frameworks, we have to make koha compliant to it step by step. - choose other design patterns: MVC cames just as an evidence in 2009 but we can do better: detect the usability of some other design patterns in koha, concider the use of helpers for them - try to find a way to have an up-to-date diagram class - here your ideas here ... this is a long reflection which need some tests, perhaps the creation of a dedicated working group about the koha future ... but the koha bugfixing and feature addition have to goes on. So, until we have a serious plan, we have to clean the code as it is, without changing the API, without breaking everything. That's why i ask again to add my helper in koha and make a quick (quicker than this above) reflection about a minimalistic koha::sql::helper (or something like that) package. thanks and regards, -- Marc Chantreux BibLibre, expert en logiciels libres pour l'info-doc http://biblibre.com
Hi Marc and all,
- try to find a way to have an up-to-date diagram class
in fact I and Matteo Romanello we are working on this task. The RFC is here: http://wiki.koha.org/doku.php?id=en:development:rfcs3.2:rfc32_koha_api_uml_d... We are writtin the description of the tables and of every field in two documents in Google Docs. Do you want to help us on doing this task ? Bye Zeno Tajoli CILEA - Segrate (MI) tajoliAT_SPAM_no_prendiATcilea.it (Indirizzo mascherato anti-spam; sostituisci quanto tra AT con @)
participants (12)
-
Andrew Moore -
Chris Cormack -
Chris Nighswonger -
Galen Charlton -
Henri-Damien LAURENT -
Joe Atzberger -
Joshua Ferraro -
Marc Chantreux -
Paul POULAIN -
Rick Welykochy -
Ryan Higgins -
Zeno Tajoli