# File lib/arjdbc/hsqldb/adapter.rb, line 139 def add_column(table_name, column_name, type, options = {}) add_column_sql = "ALTER TABLE #{quote_table_name(table_name)} ADD #{quote_column_name(column_name)} #{type_to_sql(type, options[:limit], options[:precision], options[:scale])}" add_column_options!(add_column_sql, options) execute(add_column_sql) end
do nothing since database gets created upon connection. However this method gets called by rails db rake tasks so now we're avoiding method_missing error
# File lib/arjdbc/hsqldb/adapter.rb, line 212 def create_database(name) end
# File lib/arjdbc/hsqldb/adapter.rb, line 215 def drop_database(name) execute("DROP ALL OBJECTS") end
# File lib/arjdbc/hsqldb/adapter.rb, line 168 def last_insert_id identity = select_value("CALL IDENTITY()") Integer(identity.nil? ? 0 : identity) end
# File lib/arjdbc/hsqldb/adapter.rb, line 95 def modify_types(types) super(types) types[:primary_key] = NATIVE_DATABASE_TYPES[:primary_key] types[:string] = NATIVE_DATABASE_TYPES[:string].dup #types[:integer][:limit] = nil #types[:boolean][:limit] = nil types[:text][:limit] = nil types end
# File lib/arjdbc/hsqldb/adapter.rb, line 91 def native_database_types super.merge NATIVE_DATABASE_TYPES end
# File lib/arjdbc/hsqldb/adapter.rb, line 205 def recreate_database(name, options = {}) drop_database(name) end
# File lib/arjdbc/hsqldb/adapter.rb, line 201 def remove_index(table_name, options = {}) execute "DROP INDEX #{quote_column_name(index_name(table_name, options))}" end
# File lib/arjdbc/hsqldb/adapter.rb, line 164 def rename_table(name, new_name) execute "ALTER TABLE #{name} RENAME TO #{new_name}" end
filter out system tables (that otherwise end up in db/schema.rb) JdbcConnection#tables now takes an optional block filter so we can screen out rows corresponding to system tables. HSQLDB names its system tables SYSTEM.*, but H2 seems to name them without any kind of convention
# File lib/arjdbc/hsqldb/adapter.rb, line 197 def tables @connection.tables.select { |row| row.to_s !~ /^system_/ } end
Maps logical Rails types to MySQL-specific data types.
# File lib/arjdbc/hsqldb/adapter.rb, line 158 def type_to_sql(type, limit = nil, precision = nil, scale = nil) return super if defined?(::Jdbc::H2) || type.to_s != 'integer' || limit == nil type end
Generated with the Darkfish Rdoc Generator 2.