There's an issue with the previous patch (I fatfingered the file -->
mem/MEM should be MEMORY) -- here's the fixed patch:



Index: jdbc_hsqldb.rb
===================================================================
--- jdbc_hsqldb.rb      (revision 611)
+++ jdbc_hsqldb.rb      (working copy)
@@ -93,6 +93,35 @@
       '0'
     end
 
+    # hsqldb has more than one type of table; some are purely memory
+    # resident whereas others are cached, etc...
+    # see http://hsqldb.org/doc/guide/ch09.html#create_table-section
+    # for more details
+    def create_table(name, options = {})
+      table_definition =
ActiveRecord::ConnectionAdapters::TableDefinition.new(self)
+      table_definition.primary_key(options[:primary_key] || "id")
unless options[:id] == false
+
+      yield table_definition
+
+      if options[:force]
+        drop_table(name, options) rescue nil
+      end
+
+      
+      create_sql = "CREATE" 
+      create_sql << " GLOBAL" if options[:global]
+      create_sql << " TEMPORARY"  if (options[:temporary] ||
options[:temp])
+      create_sql << " MEMORY" if options[:memory]
+      create_sql << " CACHED" if options[:cached]
+      create_sql << " TEXT" if options[:text]
+      create_sql << " TABLE " 
+      create_sql << "#{name} ("
+      create_sql << table_definition.to_sql
+      create_sql << ") #{options[:options]}"
+      execute create_sql
+    end
+
+    
     def change_column(table_name, column_name, type, options = {})
#:nodoc:
       execute "ALTER TABLE #{table_name} ALTER COLUMN #{column_name}
#{type_to_sql(type, options[:limit])}"
     end


_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel

Reply via email to