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/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;
36 DROP TABLE "Basic" CASCADE;
37 CREATE TABLE "Basic" (
39 "title" character varying(100) DEFAULT 'hello' NOT NULL,
40 "description" text DEFAULT '',
41 "email" character varying(255),
42 "explicitnulldef" character varying,
43 "explicitemptystring" character varying DEFAULT '',
45 "emptytagdef" character varying DEFAULT '',
46 "another_id" integer DEFAULT '2',
47 "timest" timestamp(0),
49 Constraint "emailuniqueindex" UNIQUE ("email")
51 CREATE INDEX "titleindex" on "Basic" ("title");
54 DROP TABLE "Another" CASCADE;
55 CREATE TABLE "Another" (
60 ALTER TABLE "Basic" ADD FOREIGN KEY ("another_id")
61 REFERENCES "Another" ("id");