- package MyApp::Schema::JournalStorage;
+=pod
+
+One of the reasons for the absurd level of flexibility that
+L<DBIx::Class::DeploymentHandler> is so that you can do things that we did not
+originally anticipate. Surprisingly, I never added a method to change the
+table for the version storage. That's fine though, the following recipe
+shows how one can do it in style:
+
+=head2 Version Storage
+
+ package MyApp::Schema::DBICDHStorage;
use Moose;
extends 'DBIx::Class::DeploymentHandler::VersionStorage::Standard';
sub _build_version_rs {
$_[0]->schema->register_class(
__VERSION =>
- 'FL::Bench::Schema::JournalTable'
+ 'MyApp::Schema::DBICDHStorageResult'
);
$_[0]->schema->resultset('__VERSION')
}
__PACKAGE__->meta->make_immutable;
1;
- package MyApp::Schema::JournalTable;
+There's not a whole lot special there. The only real bit of code to point out
+is the C<register_class> call. We make sure to point C<__VERSION> to the
+result class that we will define next.
+
+=head2 Version Result Class
+
+ package MyApp::Schema::DBICDHStorageResult;
use parent 'DBIx::Class::DeploymentHandler::VersionStorage::Standard::VersionResult';
__PACKAGE__->table('fl_bench_journal_versions');
1;
- package MyApp::Schema::Journal;
+As you can see, this is almost silly how simple it is, we just change the
+table being set on the original result.
+
+=head2 Our very own DeploymentHandler
+
+ package MyApp::Schema::DeploymentHandler;
use Moose;
extends 'DBIx::Class::DeploymentHandler::Dad';
},
'DBIx::Class::DeploymentHandler::WithApplicatorDumple' => {
interface_role => 'DBIx::Class::DeploymentHandler::HandlesVersionStorage',
- class_name => 'MyApp::Schema::JournalStorage',
+ class_name => 'MyApp::Schema::DBICDHStorage',
delegate_name => 'version_storage',
attributes_to_assume => ['schema'],
};