To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / db / migrate / 046_create_messages.rb @ 442:753f1380d6bc

History | View | Annotate | Download (733 Bytes)

1
class CreateMessages < ActiveRecord::Migration
2
  def self.up
3
    create_table :messages do |t|
4
      t.column :board_id, :integer, :null => false
5
      t.column :parent_id, :integer
6
      t.column :subject, :string, :default => "", :null => false
7
      t.column :content, :text
8
      t.column :author_id, :integer
9
      t.column :replies_count, :integer, :default => 0, :null => false
10
      t.column :last_reply_id, :integer
11
      t.column :created_on, :datetime, :null => false
12
      t.column :updated_on, :datetime, :null => false
13
    end
14
    add_index :messages, [:board_id], :name => :messages_board_id
15
    add_index :messages, [:parent_id], :name => :messages_parent_id
16
  end
17

    
18
  def self.down
19
    drop_table :messages
20
  end
21
end