6 use Test::SQL::Translator;
10 use SQL::Translator::Schema::Constants;
14 maybe_plan(1, 'SQL::Translator::Parser::XML::SQLFairy',
15 'SQL::Translator::Producer::DB2');
18 my $xmlfile = "$Bin/data/xml/schema.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;
39 id INTEGER GENERATED BY DEFAULT AS IDENTITY NOT NULL,
40 title VARCHAR(100) NOT NULL DEFAULT 'hello',
41 description VARCHAR(0) DEFAULT '',
43 explicitnulldef VARCHAR(0),
44 explicitemptystring VARCHAR(0) DEFAULT '',
45 emptytagdef VARCHAR(0) DEFAULT '',
47 CONSTRAINT emailuniqueindex UNIQUE (email) ,
51 CREATE INDEX titleindex ON Basic ( title );
53 CREATE VIEW email_list AS
54 SELECT email FROM Basic WHERE email IS NOT NULL;
56 CREATE TRIGGER foo_trigger after insert ON Basic REFERENCING OLD AS oldrow NEW AS newrow FOR EACH ROW MODE DB2SQL update modified=timestamp();