X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSQL%2FTranslator%2FParser%2FSQLite.pm;h=996935abefc9ce20c6f8cf0986ded4e55f1a856b;hb=4faaaac623abfddf02dca4d188ef8544dded37a1;hp=4f2f12b4935673793e71948b0b6dc9b0e9a363f6;hpb=900758666f4b53e9a670d84260d28b16f834f69d;p=dbsrgits%2FSQL-Translator.git diff --git a/lib/SQL/Translator/Parser/SQLite.pm b/lib/SQL/Translator/Parser/SQLite.pm index 4f2f12b..996935a 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.6 2004-02-09 22:23:40 kycl4rk Exp $ +# $Id: SQLite.pm,v 1.8 2006-06-07 16:08:45 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.6 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.8 $ =~ /(\d+)\.(\d+)/; $DEBUG = 0 unless defined $DEBUG; use Data::Dumper; @@ -191,6 +191,7 @@ eofile : /^\Z/ statement : begin_transaction | commit + | drop | comment | create | @@ -199,6 +200,8 @@ begin_transaction : /begin transaction/i SEMICOLON commit : /commit/i SEMICOLON +drop : /drop/i TABLE table_name SEMICOLON + comment : /^\s*(?:#|-{2}).*\n/ { my $comment = $item[1]; @@ -533,6 +536,8 @@ VALUE : /[-+]?\.?\d+(?:[eE]\d+)?/ } | /NULL/ { 'NULL' } + | /CURRENT_TIMESTAMP/i + { 'CURRENT_TIMESTAMP' } !; @@ -604,8 +609,8 @@ sub parse { reference_table => $cdata->{'reference_table'}, reference_fields => $cdata->{'reference_fields'}, match_type => $cdata->{'match_type'} || '', - on_delete => $cdata->{'on_delete_do'}, - on_update => $cdata->{'on_update_do'}, + on_delete => $cdata->{'on_delete'} || $cdata->{'on_delete_do'}, + on_update => $cdata->{'on_update'} || $cdata->{'on_update_do'}, ) or die $table->error; } }