diff --git a/app/models/appendable/reaction.rb b/app/models/appendable/reaction.rb new file mode 100644 index 00000000..51283ff4 --- /dev/null +++ b/app/models/appendable/reaction.rb @@ -0,0 +1,2 @@ +class Appendable::Reaction < Appendable +end diff --git a/db/migrate/20220216150127_move_smiles_to_appendables.rb b/db/migrate/20220216150127_move_smiles_to_appendables.rb new file mode 100644 index 00000000..2380e146 --- /dev/null +++ b/db/migrate/20220216150127_move_smiles_to_appendables.rb @@ -0,0 +1,6 @@ +class MoveSmilesToAppendables < ActiveRecord::Migration[6.1] + def up_only + execute "INSERT INTO appendables (type, user_id, parent_id, parent_type, content, created_at, updated_at) +(SELECT 'Appendable::Reaction' AS type, user_id, answer_id as parent_id, 'Answer' as parent_type, '🙂' AS content, created_at, updated_at FROM smiles)" + end +end