Sha256: 07225a9ec6cbb3b86fceec2593823134ab8c261aa73b564d6847b7ee1c6af3c3
Contents?: true
Size: 802 Bytes
Versions: 13
Compression:
Stored size: 802 Bytes
Contents
class KnjDB_mysql::Indexes def initialize(args) @args = args end end class KnjDB_mysql::Indexes::Index attr_reader :columns def initialize(args) @args = args @columns = [] end def name return @args[:data][:Key_name] end def table return @args[:db].tables[@args[:table_name]] end def drop sql = "DROP INDEX `#{self.name}` ON `#{self.table.name}`" @args[:db].query(sql) end def data return { "name" => name, "columns" => @columns } end #Returns true if the index is a unique-index. def unique? if @args[:data][:Index_type] == "UNIQUE" return true else return false end end #Inspect crashes if this is not present? - knj. def to_s return "#<#{self.class.name}>" end end
Version data entries
13 entries across 13 versions & 1 rubygems