6 use Test::SQL::Translator;
10 use SQL::Translator::Schema::Constants;
14 maybe_plan(1, 'SQL::Translator::Parser::XML::SQLFairy',
15 'SQL::Translator::Producer::PostgreSQL');
18 my $xmlfile = "$Bin/data/xml/samefield.xml";
21 $sqlt = SQL::Translator->new(
27 die "Can't find test schema $xmlfile" unless -e $xmlfile;
29 my $sql = $sqlt->translate(
30 from => 'XML-SQLFairy',
33 ) or die $sqlt->error;
36 DROP TABLE "one" CASCADE;
38 "same" character varying(100) DEFAULT 'hello' NOT NULL
41 DROP TABLE "two" CASCADE;
43 "same" character varying(100) DEFAULT 'hello' NOT NULL
48 ### This doesnt work, cant add a field with a name thats already there, so how do we test dupe field names?!
50 # my $table = $sqlt->schema->get_table('two');
51 # $table->add_field(name => 'same');
52 # print Dumper($table);
53 # $sql = SQL::Translator::Producer::PostgreSQL::produce($sqlt);