docbrown/db/migrate/20200311170959_create_response_templates_table.rb
Andy Zhao d08f830d86
Add response templates model and table (#6615)
* Add response templates model and table

* Add missing factory oops

* Remove response templates on delete

* Remove moderator_id column from comments for now

* Use constants and add spec for response templates
2020-03-16 09:52:03 +07:00

15 lines
559 B
Ruby

class CreateResponseTemplatesTable < ActiveRecord::Migration[5.2]
def change
create_table :response_templates do |t|
t.string "type_of", null: false # abuse_report_reply, mod_comment, email_reply, personal_comment
t.string "content_type", null: false # body_markdown, plain_text, html
t.text "content", null: false
t.string "title", null: false
t.references :user, foreign_key: true # allow null for app wide usage of templates
t.timestamps null: false
end
add_index :response_templates, :type_of
end
end