mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 11:47:56 +01:00
13 lines
335 B
Ruby
13 lines
335 B
Ruby
|
|
class CreateComments < ActiveRecord::Migration[6.0]
|
||
|
|
def change
|
||
|
|
create_table :comments do |t|
|
||
|
|
t.text :body
|
||
|
|
t.references :user, null: false, foreign_key: true
|
||
|
|
t.references :post, null: false, foreign_key: true
|
||
|
|
t.references :parent, foreign_key: { to_table: :comments }
|
||
|
|
|
||
|
|
t.timestamps
|
||
|
|
end
|
||
|
|
end
|
||
|
|
end
|