From: Arthur Axel 'fREW' Schmidt Date: Wed, 29 Feb 2012 03:17:45 +0000 (-0600) Subject: people should use schema_from_schema_loader X-Git-Tag: v0.002000~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=57a30fa87043ef203551cc84797133cc88dd03bd;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git people should use schema_from_schema_loader --- diff --git a/Changes b/Changes index fb2d744..2db8885 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,9 @@ Revision history for {{$dist->name}} {{$NEXT}} + - Added DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::ScriptHelpers, + ALL users who use perl scripts during migrations are encouraged to use + schema_from_schema_loader from that package. 0.001008 2012-02-19 10:12:34 CST6CDT - Added dep on parent, bump dep on DBD::SQLite to avoid silly failures diff --git a/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm b/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm index 5fb6918..e34a6b8 100644 --- a/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm +++ b/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm @@ -897,7 +897,10 @@ A very basic perl script might look like: use strict; use warnings; - sub { + use DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::ScriptHelpers + 'schema_from_schema_loader'; + + schema_from_schema_loader({ naming => 'v4' }, sub { my $schema = shift; # [1] for deploy, [1,2] for upgrade or downgrade, probably used with _any @@ -907,7 +910,12 @@ A very basic perl script might look like: name => 'root', password => 'root', }) - } + }) + +Note that the above uses +L. +Using a raw coderef is strongly discouraged as it is likely to break as you +modify your schema. =attr ignore_ddl