From: Jess Robinson Date: Fri, 21 Jul 2006 07:20:14 +0000 (+0000) Subject: Minor fixes to deploy / sqltargs, and more glossary X-Git-Tag: v0.07002~75^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9e7b929206599827f08743888204928c793e40b5;p=dbsrgits%2FDBIx-Class.git Minor fixes to deploy / sqltargs, and more glossary --- diff --git a/lib/DBIx/Class/Manual/Glossary.pod b/lib/DBIx/Class/Manual/Glossary.pod index 3e9d36a..818e88a 100644 --- a/lib/DBIx/Class/Manual/Glossary.pod +++ b/lib/DBIx/Class/Manual/Glossary.pod @@ -4,12 +4,38 @@ DBIx::Class::Manual::Glossary - Clarification of terms used. =head1 INTRODUCTION -This document lists various terms used in DBIx::Class and attempts to explain them. +This document lists various terms used in DBIx::Class and attempts to +explain them. =head1 TERMS +=head2 Inflation + +The act of turning database row data into objects in +language-space. DBIx::Class further allows you to inflate your data +into perl objects which more usefully represent their contents. For +example: L for datetime or +timestamp column data. + +=head2 Join + +This is an SQL keyword that gets mentioned a lot. It is used to fetch +data from more than one table at once, by Cing the tables on +fields where they have common data. + +=head2 Normalisation + +A normalised database is a sane database. Each table contains only +data belonging to one concept, related tables refer to the key field +or fields of each other. Some links to webpages about normalisation +can be found in L. + =head2 ORM +Object-relational mapping, or Object-relationship modelling. Either +way it's a method of mapping the contents of database tables (rows), +to objects in programming-language-space. DBIx::Class is an ORM. + =head2 ResultSet This is an object representing a set of data. It can either be an diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index 427faeb..47e78cf 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -751,7 +751,7 @@ sub ddl_filename my ($self, $type, $dir, $version) = @_; my $filename = ref($self); - $filename =~ s/^.*:://; + $filename =~ s/::/-/; $filename = "$dir$filename-$version-$type.sql"; return $filename; diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index e1c37d0..7c70bc6 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -953,14 +953,12 @@ sub create_ddl_dir $databases ||= ['MySQL', 'SQLite', 'PostgreSQL']; $databases = [ $databases ] if(ref($databases) ne 'ARRAY'); $version ||= $schema->VERSION || '1.x'; + $sqltargs = { ( add_drop_table => 1 ), %{$sqltargs || {}} }; eval "use SQL::Translator"; $self->throw_exception("Can't deploy without SQL::Translator: $@") if $@; - my $sqlt = SQL::Translator->new({ -# debug => 1, - add_drop_table => 1, - }); + my $sqlt = SQL::Translator->new($sqltargs); foreach my $db (@$databases) { $sqlt->reset(); @@ -1046,7 +1044,7 @@ L. sub deploy { my ($self, $schema, $type, $sqltargs) = @_; - foreach my $statement ( $self->deployment_statements($schema, $type, undef, undef, { no_comments => 1, %$sqltargs }) ) { + foreach my $statement ( $self->deployment_statements($schema, $type, undef, undef, { no_comments => 1, %{ $sqltargs || {} } } ) ) { for ( split(";\n", $statement)) { next if($_ =~ /^--/); next if(!$_);