change my nick
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Schema / Versioned.pm
index 9bcc08e..e264f22 100644 (file)
@@ -1,4 +1,5 @@
-package DBIx::Class::Version::Table;
+package # Hide from PAUSE
+  DBIx::Class::Version::Table;
 use base 'DBIx::Class';
 use strict;
 use warnings;
@@ -28,7 +29,8 @@ __PACKAGE__->add_columns
       );
 __PACKAGE__->set_primary_key('version');
 
-package DBIx::Class::Version::TableCompat;
+package # Hide from PAUSE
+  DBIx::Class::Version::TableCompat;
 use base 'DBIx::Class';
 __PACKAGE__->load_components(qw/ Core/);
 __PACKAGE__->table('SchemaVersions');
@@ -43,14 +45,16 @@ __PACKAGE__->add_columns
       );
 __PACKAGE__->set_primary_key('Version');
 
-package DBIx::Class::Version;
+package # Hide from PAUSE
+  DBIx::Class::Version;
 use base 'DBIx::Class::Schema';
 use strict;
 use warnings;
 
 __PACKAGE__->register_class('Table', 'DBIx::Class::Version::Table');
 
-package DBIx::Class::VersionCompat;
+package # Hide from PAUSE
+  DBIx::Class::VersionCompat;
 use base 'DBIx::Class::Schema';
 use strict;
 use warnings;
@@ -349,22 +353,16 @@ allows you to run your upgrade any way you please, you can call C<run_upgrade>
 any number of times to run the actual SQL commands, and in between you can
 sandwich your data upgrading. For example, first run all the B<CREATE>
 commands, then migrate your data from old to new tables/formats, then 
-issue the DROP commands when you are finished.
-
-Will run the whole file as it is by default.
+issue the DROP commands when you are finished. Will run the whole file as it is by default.
 
 =cut
 
 sub do_upgrade
 {
-    my ($self) = @_;
+  my ($self) = @_;
 
-    ## overridable sub, per default just run all the commands.
-    $self->run_upgrade(qr/create/i);
-    $self->run_upgrade(qr/alter table .*? add/i);
-    $self->run_upgrade(qr/alter table .*? (?!drop)/i);
-    $self->run_upgrade(qr/alter table .*? drop/i);
-    $self->run_upgrade(qr/drop/i);
+  # just run all the commands (including inserts) in order                                                        
+  $self->run_upgrade(qr/.*?/);
 }
 
 =head2 run_upgrade