#=============================================================================
BEGIN {
- maybe_plan(212, 'SQL::Translator::Parser::XML::SQLFairy');
+ maybe_plan(224, 'SQL::Translator::Parser::XML::SQLFairy');
}
my $testschema = "$Bin/data/xml/schema.xml";
is_primary_key => 1,
is_auto_increment => 1,
},
+ {
+ name => "num",
+ data_type => "numeric",
+ default_value => undef,
+ size => '10,2',
+ },
],
}, # end table Another
], # end tables
<extra ZEROFILL="1" />
<comments></comments>
</field>
+ <field name="bar" data_type="numeric" size="10,2" is_nullable="1" is_auto_increment="0" is_primary_key="0" is_foreign_key="0" order="2">
+ <extra />
+ <comments></comments>
+ </field>
+ <field name="baz" data_type="decimal" size="8,3" is_nullable="1" is_auto_increment="0" is_primary_key="0" is_foreign_key="0" order="3">
+ <extra />
+ <comments></comments>
+ </field>
</fields>
<indices></indices>
<constraints></constraints>
) or die $t->error;
$f->extra(ZEROFILL => "1");
+ $t->add_field(
+ name => "bar",
+ data_type => "numeric",
+ size => "10,2",
+ ) or die $t->error;
+ $t->add_field(
+ name => "baz",
+ data_type => "decimal",
+ size => [8,3],
+ ) or die $t->error;
+
+
# As we have created a Schema we give translate a dummy string so that
# it will run the produce.
lives_ok {$xml =$obj->translate("FOO");} "Translate (Field.extra) ran";
<field name="timest" size="0"
data_type="timestamp" order="7" >
</field>
+ <field name="numeric" size="9,1"
+ data_type="numeric" order="8" >
+ </field>
+ <field name="decimal" size="10,2"
+ data_type="decimal" order="9" >
+ </field>
</fields>
<indices>
size="10" data_type="int" is_auto_increment="1" order="1"
is_nullable="0">
</field>
+ <field
+ name="num"
+ size="10,2" data_type="numeric" order="2"
+ is_nullable="1">
+ </field>
</fields>
<constraints>