mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Create plpgsql language if not available
This should fix the problem in Travis CI server. (http://travis-ci.org/#!/rails/rails/jobs/1194988)
This commit is contained in:
parent
47a87fb0ec
commit
5156110476
1 changed files with 27 additions and 19 deletions
|
@ -127,6 +127,7 @@ _SQL
|
|||
);
|
||||
_SQL
|
||||
|
||||
begin
|
||||
execute <<_SQL
|
||||
CREATE TABLE postgresql_partitioned_table_parent (
|
||||
id SERIAL PRIMARY KEY,
|
||||
|
@ -148,7 +149,14 @@ _SQL
|
|||
BEFORE INSERT ON postgresql_partitioned_table_parent
|
||||
FOR EACH ROW EXECUTE PROCEDURE partitioned_insert_trigger();
|
||||
_SQL
|
||||
|
||||
rescue ActiveRecord::StatementInvalid => e
|
||||
if e.message =~ /language "plpgsql" does not exist/
|
||||
execute "CREATE LANGUAGE 'plpgsql';"
|
||||
retry
|
||||
else
|
||||
raise e
|
||||
end
|
||||
end
|
||||
|
||||
begin
|
||||
execute <<_SQL
|
||||
|
|
Loading…
Reference in a new issue