From: Peter Rabbitson Date: Sun, 21 Sep 2008 22:31:38 +0000 (+0000) Subject: Unregister a source before registering it again X-Git-Tag: v0.08240~332^2~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=72c1b3a4c86220c1a15a47feecba48ea26c1ea20;p=dbsrgits%2FDBIx-Class.git Unregister a source before registering it again --- diff --git a/t/94versioning.t b/t/94versioning.t index 633100e..15b76b8 100644 --- a/t/94versioning.t +++ b/t/94versioning.t @@ -41,7 +41,10 @@ $schema_orig->deploy({ add_drop_table => 1 }); my $tvrs = $schema_orig->{vschema}->resultset('Table'); is($schema_orig->_source_exists($tvrs), 1, 'Created schema from DDL file'); +# loading a new module defining a new version of the same table +DBICVersion::Schema->_unregister_source ('Table'); eval "use DBICVersionNew"; + { unlink('t/var/DBICVersion-Schema-2.0-MySQL.sql'); unlink('t/var/DBICVersion-Schema-1.0-2.0-MySQL.sql'); @@ -51,6 +54,7 @@ eval "use DBICVersionNew"; is($schema_upgrade->schema_version, '2.0', 'schema version ok'); $schema_upgrade->create_ddl_dir('MySQL', '2.0', 't/var', '1.0'); ok(-f 't/var/DBICVersion-Schema-1.0-2.0-MySQL.sql', 'Created DDL file'); + $schema_upgrade->upgrade(); is($schema_upgrade->get_db_version(), '2.0', 'db version number upgraded');