From: Luke Saunders Date: Mon, 7 Jul 2008 12:11:32 +0000 (+0000) Subject: moved schema_version from Versioning to core X-Git-Tag: v0.08240~409 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=commitdiff_plain;h=5b60f0c107afa5bfac568b691f663e2430df7618 moved schema_version from Versioning to core --- diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index 39bf2e8..21f055b 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -62,6 +62,29 @@ particular which module inherits off which. =head1 METHODS +=head2 schema_version + +Returns the current schema class' $VERSION + +=cut + +sub schema_version { + my ($self) = @_; + my $class = ref($self)||$self; + + # does -not- use $schema->VERSION + # since that varies in results depending on if version.pm is installed, and if + # so the perl or XS versions. If you want this to change, bug the version.pm + # author to make vpp and vxs behave the same. + + my $version; + { + no strict 'refs'; + $version = ${"${class}::VERSION"}; + } + return $version; +} + =head2 register_class =over 4 diff --git a/lib/DBIx/Class/Schema/Versioned.pm b/lib/DBIx/Class/Schema/Versioned.pm index 877b841..0799202 100644 --- a/lib/DBIx/Class/Schema/Versioned.pm +++ b/lib/DBIx/Class/Schema/Versioned.pm @@ -129,26 +129,6 @@ __PACKAGE__->mk_classdata('backup_directory'); __PACKAGE__->mk_classdata('do_backup'); __PACKAGE__->mk_classdata('do_diff_on_init'); -=head2 schema_version - -Returns the current schema class' $VERSION; does -not- use $schema->VERSION -since that varies in results depending on if version.pm is installed, and if -so the perl or XS versions. If you want this to change, bug the version.pm -author to make vpp and vxs behave the same. - -=cut - -sub schema_version { - my ($self) = @_; - my $class = ref($self)||$self; - my $version; - { - no strict 'refs'; - $version = ${"${class}::VERSION"}; - } - return $version; -} - =head2 get_db_version Returns the version that your database is currently at. This is determined by the values in the