theory/module-build-db — Issue #1: Create metadata Table If it does not exist
Author: theory
Created: 2012-01-06 06:09:25+00:00
State: open

Currently, the metadata table is only created if the database does not exist and is created. Need to add a `get_check_table_command` method to each driver, and then call it in the appropriate place in `ACTION_db` to determine whether the table needs to be created. Something like this:

--- a/lib/Module/Build/DB.pm
+++ b/lib/Module/Build/DB.pm
@@ -375,6 +375,11 @@ sub ACTION_db {
) or die;
} else {
# Just run the upgrades and be done with it.
+ $self->create_meta_table( $db, $cmd ) unless $self->_probe(
+ $self->{driver}->get_table_db_command($cmd, $db)
+ );
+ );
+
$self->upgrade_db( $db, $cmd );
return;
}