X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema.pm;h=4cc9d6035b7ddc86435cb33e663a174b5def41d7;hb=760823042a2ce10d6976adf42b9170be1d563f2e;hp=47e78cf81ff07cd61a7ea8104dea99881d6b8fe8;hpb=9e7b929206599827f08743888204928c793e40b5;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index 47e78cf..4cc9d60 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -169,6 +169,12 @@ For example: sub sources { return keys %{shift->source_registrations}; } +=head2 storage + + my $storage = $schema->storage; + +Returns the L object for this Schema. + =head2 resultset =over 4 @@ -625,7 +631,9 @@ copy. sub clone { my ($self) = @_; - my $clone = bless({ (ref $self ? %$self : ()) }, ref $self || $self); + my $clone = { (ref $self ? %$self : ()) }; + bless $clone, (ref $self || $self); + foreach my $moniker ($self->sources) { my $source = $self->source($moniker); my $new = $source->new($source); @@ -692,7 +700,7 @@ sub throw_exception { =over 4 -=item Arguments: $sqlt_args +=item Arguments: $sqlt_args, $dir =back @@ -708,9 +716,9 @@ produced include a DROP TABLE statement for each table created. =cut sub deploy { - my ($self, $sqltargs) = @_; + my ($self, $sqltargs, $dir) = @_; $self->throw_exception("Can't deploy without storage") unless $self->storage; - $self->storage->deploy($self, undef, $sqltargs); + $self->storage->deploy($self, undef, $sqltargs, $dir); } =head2 create_ddl_dir (EXPERIMENTAL) @@ -729,8 +737,7 @@ across all databases, or fully handle complex relationships. =cut -sub create_ddl_dir -{ +sub create_ddl_dir { my $self = shift; $self->throw_exception("Can't create_ddl_dir without storage") unless $self->storage; @@ -746,8 +753,7 @@ intended for direct end user use. =cut -sub ddl_filename -{ +sub ddl_filename { my ($self, $type, $dir, $version) = @_; my $filename = ref($self); @@ -768,4 +774,3 @@ Matt S. Trout You may distribute this code under the same terms as Perl itself. =cut -