mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-11-03 03:34:26 -05:00
20 lines
485 B
Ruby
20 lines
485 B
Ruby
# frozen_string_literal: true
|
|
|
|
class RequireFieldsForComments < ActiveRecord::Migration[4.2]
|
|
def up
|
|
change_table :comments do |t|
|
|
t.change :post_id, :integer, null: false
|
|
t.change :author_id, :integer, null: false
|
|
t.change :body, :text, null: false
|
|
end
|
|
end
|
|
|
|
def down
|
|
change_table :comments do |t|
|
|
t.change :post_id, :integer, null: true
|
|
t.change :author_id, :integer, null: true
|
|
t.change :body, :text, null: true
|
|
end
|
|
end
|
|
end
|