class Letter ActiveRecord Base def self up create_table letter do tbl

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
class Letter < ActiveRecord::Base
def self.up
create_table :letter do |tbl|
tbl.column :recipient, :string #Recipient's address
tbl.column :subject, :string # Letter Subject
tbl.column :body_text, :text # Letter Body
tbl.column :create_date, :datetime # Letter creation date
tbl.column :important_flag, :integer, {:default => 0} # Letter important? 0/1 - no/yes
tbl.column :folder, :integer, {:default => 0} #Folder - 0/1 outgoing/trash
end
end
def self.down
drop_table :letter
end
end