class CreateServers < ActiveRecord::Migration def self.up create_table :servers do |t| t.integer :account_id, :null=>false t.string :server_name, :limit=>255, :null=>false t.timestamps end add_index :servers, [:server_name, :account_id], :unique => true end def self.down drop_table :servers end end