class <%= class_name %> < ActiveRecord::Migration @tablename = :settings def self.up create_table @tablename do |t| t.string :key, :null => false t.text :value end add_index @tablename, :key end def self.down remove_index @tablename, :key drop_table @tablename end end