From: Dagfinn Ilmari Mannsåker Date: Sat, 20 Sep 2014 16:07:09 +0000 (+0100) Subject: Handle ALTER TABLE ... ADD CONSTRAINT in Parser::Oracle X-Git-Tag: v0.11021~15^2~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2d6f061e14a59b2e22fd9e3515da52f5f8173c74;p=dbsrgits%2FSQL-Translator.git Handle ALTER TABLE ... ADD CONSTRAINT in Parser::Oracle --- diff --git a/Changes b/Changes index d5afb23..1a6b2b5 100644 --- a/Changes +++ b/Changes @@ -7,6 +7,7 @@ Changes for SQL::Translator * Fixes for parsing and producing identifiers and values that need quoting and escaping for SQLite, MySQL, PostgreSQL, SQLServer and Oracle (RT#90700, RT#31034) + * Add support for ALTER TABLE ... ADD CONSTRAINT to Oracle parser 0.11020 2014-09-02 diff --git a/lib/SQL/Translator/Parser/Oracle.pm b/lib/SQL/Translator/Parser/Oracle.pm index 2f03d67..d5c1b29 100644 --- a/lib/SQL/Translator/Parser/Oracle.pm +++ b/lib/SQL/Translator/Parser/Oracle.pm @@ -123,6 +123,13 @@ statement : remark | drop | +alter: /alter/i TABLE table_name /add/i table_constraint ';' + { + my $constraint = $item{table_constraint}; + $constraint->{type} = $constraint->{constraint_type}; + push @{$tables{$item{table_name}}{constraints}}, $constraint; + } + alter : /alter/i WORD /[^;]+/ ';' { @table_comments = () }