Closed KES777 closed 5 years ago
This happen only on project where Result
classes use Moose
.
On project without Moose this does not happen.
A few more information on this.
I set breakpoint at /DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm:500 when downgrade script is generated.
>>500: return [SQL::Translator::Diff::schema_diff(
501: $source_schema, $db,
502: $dest_schema, $db,
503: { producer_args => $sqltargs }
504: )];
One interesting fact that same method from same file is different for $source_schema
VS $dest_schema
.
$dest_schema:
ch_saldo => SQL::Translator::Schema::Procedure {
_ERROR => ,
comments => [
,
],
extra => {
definitions => [
{
language => plpgsql,
},
{
attribute => VOLATILE,
},
{
body => /*ТолÑко ÑÑммаÑнÑй ÑÑÑÑ Ð¿Ð¾ ÑÑÑÑÑ*/
DECLARE _YearFrom smallint;/**/
DECLARE _YearTo smallint;/**/
DECLARE _MonthFrom smallint;/**/
DECLARE _MonthTo smallint;/**/
$source_schema:
ch_saldo => SQL::Translator::Schema::Procedure {
_ERROR => ,
comments => [
,
],
extra => {
definitions => [
{
language => plpgsql,
},
{
attribute => VOLATILE,
},
{
body => /*Только суммарный учёт по счёту*/
DECLARE _YearFrom smallint;/**/
DECLARE _YearTo smallint;/**/
DECLARE _MonthFrom smallint;/**/
DECLARE _MonthTo smallint;/**/
As you can see $dest_schema is not UTF8 decoded
It is worth to mention that SQL added by sub sqlt_deploy_hook {
called from App::Schema
in both cases: for $source and $dest is both decoded correctly.
All files: App::Schema
and ::Result
package both have use utf8
I use this patch which adds stored procedures: https://github.com/dbsrgits/sql-translator/issues/82
This is a bug (which I agree, an actual bug) in either DBICDH or, more likely, SQLT. It needs reporting there. This module cannot fix it.
If my
Result/Table.pm
looks like:When I run
prepare
command I get migration script with broken comments: