X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F46xml-to-pg.t;h=61a354d00c788fa6558a153074e2db67b78f3083;hb=cb9bbc68fe26aa563d28d590221f6a0235b4062e;hp=dcf08afce72c42af5b2567165c40b40d5eb42c91;hpb=2ae88fa44963dc20385a0f22389cd439f866b0f0;p=dbsrgits%2FSQL-Translator.git diff --git a/t/46xml-to-pg.t b/t/46xml-to-pg.t index dcf08af..61a354d 100644 --- a/t/46xml-to-pg.t +++ b/t/46xml-to-pg.t @@ -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,28 +39,38 @@ 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), + "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") ); 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) +; + +DROP TRIGGER IF EXISTS foo_trigger; + +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();; ALTER TABLE "Basic" ADD FOREIGN KEY ("another_id") REFERENCES "Another" ("id") DEFERRABLE;