mirror of
https://github.com/zhigang1992/tsemple.git
synced 2026-01-12 22:53:00 +08:00
14 lines
335 B
Ruby
14 lines
335 B
Ruby
class CreateComments < ActiveRecord::Migration
|
|
def change
|
|
create_table :comments do |t|
|
|
t.belongs_to :user, index: true
|
|
t.belongs_to :commentable, polymorphic: true, index: true
|
|
t.text :body
|
|
t.integer :likes_count, default: 0
|
|
t.boolean :trashed, default: false
|
|
|
|
t.timestamps
|
|
end
|
|
end
|
|
end
|