From: Jess Robinson Date: Thu, 8 Jun 2006 21:02:20 +0000 (+0000) Subject: SQLite and YAML tests broken, fixed X-Git-Tag: v0.11008~425 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=da2f599235eeacb8336fda55e160402ad03db4fb;p=dbsrgits%2FSQL-Translator.git SQLite and YAML tests broken, fixed Also made SQLite parser actually used the parsed table naem --- diff --git a/lib/SQL/Translator/Parser/SQLite.pm b/lib/SQL/Translator/Parser/SQLite.pm index 996935a..d03bc61 100644 --- a/lib/SQL/Translator/Parser/SQLite.pm +++ b/lib/SQL/Translator/Parser/SQLite.pm @@ -1,7 +1,7 @@ package SQL::Translator::Parser::SQLite; # ------------------------------------------------------------------- -# $Id: SQLite.pm,v 1.8 2006-06-07 16:08:45 schiffbruechige Exp $ +# $Id: SQLite.pm,v 1.9 2006-06-08 21:02:19 schiffbruechige Exp $ # ------------------------------------------------------------------- # Copyright (C) 2002-4 SQLFairy Authors # @@ -152,7 +152,7 @@ like-op::= use strict; use vars qw[ $DEBUG $VERSION $GRAMMAR @EXPORT_OK ]; -$VERSION = sprintf "%d.%02d", q$Revision: 1.8 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.9 $ =~ /(\d+)\.(\d+)/; $DEBUG = 0 unless defined $DEBUG; use Data::Dumper; @@ -421,6 +421,7 @@ create : CREATE TEMPORARY(?) TRIGGER NAME before_or_after(?) database_event ON t instead_of => 0, db_event => $item[6], action => $item[9], + on_table => $table_name, } } @@ -434,6 +435,7 @@ create : CREATE TEMPORARY(?) TRIGGER NAME instead_of database_event ON view_name instead_of => 1, db_event => $item[6], action => $item[9], + on_table => $table_name, } } @@ -628,6 +630,7 @@ sub parse { perform_action_when => $def->{'when'}, database_event => $def->{'db_event'}, action => $def->{'action'}, + on_table => $def->{'on_table'}, ); } diff --git a/t/24yaml.t b/t/24yaml.t index 78c1c29..53520d9 100644 --- a/t/24yaml.t +++ b/t/24yaml.t @@ -206,7 +206,7 @@ schema: options: [] order: 2 triggers: - after: + pet_trig: action: for_each: ~ steps: @@ -214,10 +214,10 @@ schema: when: ~ database_event: insert fields: ~ - name: after - on_table: ~ + name: pet_trig + on_table: pet order: 1 - perform_action_when: ~ + perform_action_when: after views: person_pet: fields: '' @@ -248,6 +248,8 @@ my $tr = SQL::Translator->new( parser => 'SQLite', producer => 'YAML', data => $data, +# debug => 1, +# trace => 1, ); my $out; diff --git a/t/data/sqlite/create.sql b/t/data/sqlite/create.sql index b404a69..f46b719 100644 --- a/t/data/sqlite/create.sql +++ b/t/data/sqlite/create.sql @@ -18,7 +18,7 @@ create table pet ( primary key (pet_id, person_id) ); -create trigger after insert on pet +create trigger pet_trig after insert on pet begin update name=name; end