X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FSQL-Translator.git;a=blobdiff_plain;f=t%2F46xml-to-pg.t;h=d9dd3277b95ed530e85743ae66571ab51d811613;hp=215d42fce2c1a4953c54b63199e58f1651f39120;hb=c0ec0e22d3f0e3852c00daac5ef5763010b410c3;hpb=e1b1c9483066f211617f73d6f1e8d38452b5d0a2 diff --git a/t/46xml-to-pg.t b/t/46xml-to-pg.t index 215d42f..d9dd327 100644 --- a/t/46xml-to-pg.t +++ b/t/46xml-to-pg.t @@ -44,16 +44,18 @@ CREATE TABLE "Basic" ( "explicitemptystring" character varying DEFAULT '', -- Hello emptytagdef "emptytagdef" character varying DEFAULT '', - "another_id" integer DEFAULT '2', + "another_id" integer DEFAULT 2, "timest" timestamp, PRIMARY KEY ("id"), - CONSTRAINT "emailuniqueindex" UNIQUE ("email") + CONSTRAINT "emailuniqueindex" UNIQUE ("email"), + CONSTRAINT "very_long_index_name_on_title_field_which_should_be_truncated_for_various_rdbms" UNIQUE ("title") ); CREATE INDEX "titleindex" on "Basic" ("title"); DROP TABLE "Another" CASCADE; CREATE TABLE "Another" ( "id" serial NOT NULL, + "num" numeric(10,2), PRIMARY KEY ("id") ); @@ -62,12 +64,15 @@ 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; +DROP TRIGGER IF EXISTS "foo_trigger"; + +CREATE TRIGGER "foo_trigger" after insert ON "Basic" FOR EACH row update modified=timestamp();; -CREATE TRIGGER foo_trigger after insert ON Basic update modified=timestamp();; +DROP TRIGGER IF EXISTS "bar_trigger"; -CREATE TRIGGER bar_trigger before insert or update ON Basic update modified2=timestamp();; +CREATE TRIGGER "bar_trigger" before insert OR update ON "Basic" FOR EACH row update modified2=timestamp();; + +ALTER TABLE "Basic" ADD FOREIGN KEY ("another_id") + REFERENCES "Another" ("id") DEFERRABLE; -select foo from bar SQL