added DBIx::Class schema "migration" script + test in generated_app.t
Devin Austin [Fri, 17 Jul 2009 01:51:03 +0000 (01:51 +0000)]
lib/Catalyst/Helper.pm
t/generated_app.t

index 871985f..703e939 100644 (file)
@@ -110,6 +110,7 @@ sub mk_app {
         $self->_mk_cgi;
         $self->_mk_fastcgi;
         $self->_mk_server;
+        $self->_mk_dbic_deploy;
         $self->_mk_test;
         $self->_mk_create;
         $self->_mk_information;
@@ -473,6 +474,14 @@ sub _mk_favicon {
 
 }
 
+sub _mk_dbic_deploy {
+    my $self      = shift;
+    my $script    = $self->{script};
+    my $appprefix = $self->{appprefix};
+    $self->render_sharedir_file( File::Spec->catfile('script', 'myapp_deploy_schema.pl.tt'), "$script\/$appprefix\_deploy_schema.pl" );
+    chmod 0700, "$script/$appprefix\_deploy_schema.pl";
+}
+
 sub _deprecate_file {
     my ( $self, $file ) = @_;
     if ( -e $file ) {
@@ -516,6 +525,10 @@ development stage.
 The catalyst test server, starts an HTTPD which outputs debugging to
 the terminal.
 
+=head2 _deploy_dbic.pl
+
+Deploy a L<DBIx::Class> schema to the database of your choice. 
+
 =head2 _test.pl
 
 A script for running tests from the command-line.
index b9c9f68..871abb2 100644 (file)
@@ -49,6 +49,7 @@ script/testapp_fastcgi.pl
 script/testapp_server.pl
 script/testapp_test.pl
 script/testapp_create.pl
+script/testapp_deploy_schema.pl
 |;
 
 plan 'tests' => scalar @files + 4;