class Scheman::Views::Mysql::Index

Public Instance Methods

column() click to toggle source

@example

"id"
# File lib/scheman/views/mysql.rb, line 341
def column
  @element[:column]
end
fulltext?() click to toggle source
# File lib/scheman/views/mysql.rb, line 331
def fulltext?
  @element[:type] == "fulltext"
end
prefix() click to toggle source

@example

"PRIMARY KEY"
# File lib/scheman/views/mysql.rb, line 347
def prefix
  case
  when primary_key?
    "PRIMARY KEY"
  when fulltext?
    "FULLTEXT"
  when spatial?
    "SPATIAL"
  else
    "KEY"
  end
end
primary_key?() click to toggle source
# File lib/scheman/views/mysql.rb, line 327
def primary_key?
  !!@element[:primary]
end
spatial?() click to toggle source
# File lib/scheman/views/mysql.rb, line 335
def spatial?
  @element[:type] == "spatial"
end
to_s() click to toggle source
# File lib/scheman/views/mysql.rb, line 323
def to_s
  "#{prefix} (`#{column}`)"
end