Title: [885] trunk/activerecord-jdbc/lib/jdbc_adapter/jdbc_mysql.rb:
Fix for JRUBY-2012, by Tyler Jennings
- Revision
- 885
- Author
- olabini
- Date
- 2008-01-24 10:11:47 -0500 (Thu, 24 Jan 2008)
Log Message
Fix for JRUBY-2012, by Tyler Jennings
Modified Paths
Diff
Modified: trunk/activerecord-jdbc/lib/jdbc_adapter/jdbc_mysql.rb (884 => 885)
--- trunk/activerecord-jdbc/lib/jdbc_adapter/jdbc_mysql.rb 2008-01-22 16:12:04 UTC (rev 884)
+++ trunk/activerecord-jdbc/lib/jdbc_adapter/jdbc_mysql.rb 2008-01-24 15:11:47 UTC (rev 885)
@@ -131,7 +131,14 @@
select_all(sql).inject("") do |structure, table|
table.delete('Table_type')
- structure += select_one("SHOW CREATE TABLE #{quote_table_name(table.to_a.first.last)}")["Create Table"] + ";\n\n"
+
+ hash = select_one("SHOW CREATE TABLE #{quote_table_name(table.to_a.first.last)}")
+
+ if(table = hash["Create Table"])
+ structure += table + ";\n\n"
+ elsif(view = hash["Create View"])
+ structure += view + ";\n\n"
+ end
end
end
_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel