module EnumTable::SchemaStatements

Constants

DEFAULT_VALUE_ATTRIBUTES

Public Instance Methods

change_enum_table(table_name) { |table| ... } click to toggle source
# File lib/enum_table/schema_statements.rb, line 10
def change_enum_table(table_name)
  yield Table.new(self, table_name)
end
create_enum_table(table_name, options={}) { |table| ... } click to toggle source
# File lib/enum_table/schema_statements.rb, line 3
def create_enum_table(table_name, options={})
  table = NewTable.new(self, table_name, options)
  yield table if block_given?
  table._create
  enum_tables_updated
end
drop_enum_table(table_name) click to toggle source
# File lib/enum_table/schema_statements.rb, line 14
def drop_enum_table(table_name)
  drop_table table_name
  execute "DELETE FROM enum_tables WHERE table_name = #{quote table_name}"
  enum_tables_updated
end
enum_tables() click to toggle source
# File lib/enum_table/schema_statements.rb, line 20
def enum_tables
  return [] if !table_exists?('enum_tables')
  @enum_tables ||= execute("SELECT table_name FROM enum_tables").
    map { |row| row[0] }.sort
end
enum_tables_updated() click to toggle source
# File lib/enum_table/schema_statements.rb, line 26
def enum_tables_updated
  @enum_tables = nil
end