On Wed, 28 Feb 2007, Carl Vincent wrote:

Hi,

I know it's marked EXPERIMENTAL, but I've been brave and had a go with
the deploy stuff in DBIx::Class::Schema.

Works fine for me for SQLite which helps me no end with tests. It's a
bit less reliable with MySQL.

I hit a problem with long package names:

If your schema class is "Company::Project::Schema"
$schema->create_ddl_dir produces sql in a file named
"Company-Project::Schema-0.01-SQLite.sql"

Those colons upset my Fedora Core 6 box, and completely foxed my windows
box!

I've made a fix to the regexp that creates the filename:

$ svn diff lib/DBIx/Class/Schema.pm
Index: lib/DBIx/Class/Schema.pm
===================================================================
--- lib/DBIx/Class/Schema.pm    (revision 3105)
+++ lib/DBIx/Class/Schema.pm    (working copy)
@@ -788,7 +788,7 @@
    my ($self, $type, $dir, $version) = @_;

    my $filename = ref($self);
-    $filename =~ s/::/-/;
+    $filename =~ s/::/-/g;
    $filename = "$dir$filename-$version-$type.sql";

    return $filename;



I'm taking the cowards line with respect to the tests - there doesn't
seem to be any for the deploy code... If I'm mistaken I'll look at
updating tests if someone points me the right way.


Hi Carl,

Woops, thanks for that, I'll update it.

Hmm, are there really no tests? The versioning tests in -current test it, but if theres none just for deploy, maybe we need some.

Jess


_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to