class CreateRoles < ActiveRecord::Migration def self.up create_table :roles do |t| t.column :name, :string, :limit => 128, :null => false t.column :code, :string, :limit => 128, :null => false t.column :about, :string, :limit => 128, :null => false t.timestamps end # Create constraints add_index :roles, :name, :unique add_index :roles, :code, :unique end def self.down drop_table :roles end end