lib/knj/knjdb/drivers/sqlite3/knjdb_sqlite3_tables.rb in knjrbfw-0.0.34 vs lib/knj/knjdb/drivers/sqlite3/knjdb_sqlite3_tables.rb in knjrbfw-0.0.35

- old
+ new

@@ -331,9 +331,13 @@ end end def create_indexes(index_arr) index_arr.each do |index_data| + if index_data.is_a?(String) + index_data = {"name" => index_data, "columns" => [index_data]} + end + raise "No name was given." if !index_data.key?("name") or index_data["name"].strip.length <= 0 raise "No columns was given on index #{index_data["name"]}." if index_data["columns"].empty? name = index_data["name"] name = "#{self.name}__#{name}" if @db.opts[:index_append_table_name] \ No newline at end of file