X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FDeploymentHandler%2FManual%2FIntro.pod;h=d366ea8e3e0eb536557a6ae6f92190052e4b47d6;hb=1e171480f0cad3034557f3b606c31962fe9b85b1;hp=1ca76f1a092662ddac1fb287b6adb238afd897a7;hpb=af333e79b0a77a2dd4e72873c4e7a024b936e80d;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git diff --git a/lib/DBIx/Class/DeploymentHandler/Manual/Intro.pod b/lib/DBIx/Class/DeploymentHandler/Manual/Intro.pod index 1ca76f1..d366ea8 100644 --- a/lib/DBIx/Class/DeploymentHandler/Manual/Intro.pod +++ b/lib/DBIx/Class/DeploymentHandler/Manual/Intro.pod @@ -43,7 +43,7 @@ this makes versioning much simpler for figuring out what version is next Our first script, C reads our schema file and creates the tables in the database. - #!perl + #!/usr/bin/env perl use strict; use warnings; use aliased 'DBIx::Class::DeploymentHandler' => 'DH'; @@ -90,17 +90,17 @@ translated into the sql. To truly take advantage of all DBIx::Class::DeploymentHandler offers, you should probably be using it for population. To do that all you need to do -is create a file called C: - - sub { - my $schema = shift; - $schema->resultset('User')->populate([ - ['name'], - ['Marillion'], - ['The Moutain Goats'], - ['Ladyhawke'], - ]); - }; +is create a file called C: + + sub { + my $schema = shift; + $schema->resultset('Artist')->populate([ + ['artistid', 'name'], + [1, 'Marillion'], + [2, 'The Moutain Goats'], + [3, 'Ladyhawke'], + ]); + }; =head1 Upgrading @@ -117,9 +117,15 @@ fail for logical reasons. To be clear, if you add a column to a database and it is not nullable and has no default, what will the existing rows contain for that column? +Now you need to modify the schema version in your MyDatabase::Main file to +tell DBIx::Class::DeploymentHandler the new schema version number. You will +want to remember the earlier advice about integer version numbers. + + our $VERSION = 2; + So here is our next script, C: - #!perl + #!/usr/bin/env perl use strict; use warnings; use aliased 'DBIx::Class::DeploymentHandler' => 'DH';