added expected trigger and stored procedure output
[dbsrgits/SQL-Translator.git] / t / 46xml-to-pg.t
index dcf08af..215d42f 100644 (file)
@@ -21,7 +21,7 @@ my $xmlfile = "$Bin/data/xml/schema.xml";
 my $sqlt;
 $sqlt = SQL::Translator->new(
     no_comments => 1,
-    show_warnings  => 1,
+    show_warnings  => 0,
     add_drop_table => 1,
 );
 
@@ -39,13 +39,13 @@ CREATE TABLE "Basic" (
   "id" serial NOT NULL,
   "title" character varying(100) DEFAULT 'hello' NOT NULL,
   "description" text DEFAULT '',
-  "email" character varying(255),
+  "email" character varying(500),
   "explicitnulldef" character varying,
   "explicitemptystring" character varying DEFAULT '',
   -- Hello emptytagdef
   "emptytagdef" character varying DEFAULT '',
   "another_id" integer DEFAULT '2',
-  "timest" timestamp(0),
+  "timest" timestamp,
   PRIMARY KEY ("id"),
   CONSTRAINT "emailuniqueindex" UNIQUE ("email")
 );
@@ -58,11 +58,16 @@ CREATE TABLE "Another" (
 );
 
 DROP VIEW "email_list";
-CREATE VIEW "email_list" ( "email" ) AS (
-    SELECT email FROM Basic WHERE email IS NOT NULL
-  );
+CREATE VIEW "email_list" ( "email" ) AS
+    SELECT email FROM Basic WHERE (email IS NOT NULL)
+;
 
 ALTER TABLE "Basic" ADD FOREIGN KEY ("another_id")
   REFERENCES "Another" ("id") DEFERRABLE;
 
+CREATE TRIGGER foo_trigger after insert ON Basic update modified=timestamp();;
+
+CREATE TRIGGER bar_trigger before insert or update ON Basic update modified2=timestamp();;
+
+select foo from bar
 SQL