use Method::Signatures::Simple;
use File::Spec::Functions;
+require SQL::Translator::Diff;
extends 'DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator',
$filename =~ s/::/-/g;
$filename = catfile(
- $self->upgrade_directory, "$filename-$version-$type.sql"
+ $self->script_directory, "$filename-$version-$type.sql"
);
return $filename;
$filename =~ s/::/-/g;
$filename = catfile(
- $self->upgrade_directory, "$filename-" . join( q(-), @{$versions} ) . "-$type.sql"
+ $self->script_directory, "$filename-" . join( q(-), @{$versions} ) . "-$type.sql"
);
return $filename;
return [$self->_ddl_schema_up_produce_filename($type, $versions)]
}
+method _generate_final_diff($source_schema, $dest_schema, $db, $sqltargs) {
+ scalar SQL::Translator::Diff::schema_diff(
+ $source_schema, $db,
+ $dest_schema, $db,
+ $sqltargs
+ )
+}
+
+method _default_read_sql_file_as_string($file) {
+ do { local( @ARGV, $/ ) = $file; <> } # slurp
+}
+
+method _generate_final_sql($sqlt) { scalar $sqlt->translate }
+
__PACKAGE__->meta->make_immutable;
1;
__END__
+=head1 DESCRIPTION
+
+All this module does is override a few parts of
+L<DBIx::Class::DeployMethd::SQL::Translator> so that the files generated with
+L<DBIx::Class::Schema::Versioned> will work with this out of the box.
+
+=head1 DEPRECATED
+
+I begrudgingly made this module (and other related modules) to keep porting
+from L<DBIx::Class::Schema::Versioned> relatively simple. I will make changes
+to ensure that it works with output from L<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.
+
=head1 THIS SUCKS
Yeah, this old Deprecated thing is a drag. It can't do downgrades, it can only
}
}
+=head1 OVERRIDDEN METHODS
+
+=over
+
+=item *
+
+L<DBIx::Class::DeployMethod::SQL::Translator/_ddl_schema_consume_filenames>
+
+=item *
+
+L<DBIx::Class::DeployMethod::SQL::Translator/_ddl_schema_produce_filename>
+
+=item *
+
+L<DBIx::Class::DeployMethod::SQL::Translator/_ddl_schema_up_produce_filename>
+
+=item *
+
+L<DBIx::Class::DeployMethod::SQL::Translator/_ddl_schema_up_consume_filenames>
+
+=back
+