logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::Deprecated - (DEPRECATED) Use this if you

Author

       Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>

Deprecated

       I begrudgingly made this module (and other related modules) to keep porting from
       DBIx::Class::Schema::Versioned relatively simple.  I will make changes to ensure that it works with
       output from DBIx::Class::Schema::Versioned etc, but I will not add any new features to it.

       Once I hit major version 1 usage of this module will emit a warning.  On version 2 it will be removed
       entirely.

Description

       All this module does is override a few parts of DBIx::Class::DeployMethd::SQL::Translator so that the
       files generated with DBIx::Class::Schema::Versioned will work with this out of the box.

Name

       DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::Deprecated - (DEPRECATED) Use this if you
       are stuck in the past

Overridden Methods

       •   "_ddl_schema_consume_filenames" in DBIx::Class::DeployMethod::SQL::Translator

       •   "_ddl_schema_produce_filename" in DBIx::Class::DeployMethod::SQL::Translator

       •   "_ddl_schema_up_produce_filename" in DBIx::Class::DeployMethod::SQL::Translator

       •   "_ddl_schema_up_consume_filenames" in DBIx::Class::DeployMethod::SQL::Translator

See Also

       This  class  is  an implementation of DBIx::Class::DeploymentHandler::HandlesDeploy.  Pretty much all the
       documentation is there.

This Sucks

       Yeah, this old Deprecated thing is a drag.  It can't do downgrades, it can only use a single .sql file
       for migrations, it has no .pl support.  You should totally switch!  Here's how:

        my $init_part = ref $schema;
        $init_part =~ s/::/-/g;
        opendir my $dh, 'sql';
        for (readdir $dh) {
          if (/\Q$init_part\E-(.*)-(.*)(?:-(.*))?/) {
           if (defined $3) {
             cp $_, $dh->deploy_method->_ddl_schema_up_produce_filename($3, [$1, $2]);
           } else {
             cp $_, $dh->deploy_method->_ddl_schema_produce_filename($2, $1);
           }
         }
        }

return

See Also