mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 14:29:53 +01:00
Add migration for converting smiles to reaction appendable
This commit is contained in:
parent
544e9c8fa6
commit
1e53f00032
2 changed files with 8 additions and 0 deletions
2
app/models/appendable/reaction.rb
Normal file
2
app/models/appendable/reaction.rb
Normal file
|
@ -0,0 +1,2 @@
|
|||
class Appendable::Reaction < Appendable
|
||||
end
|
6
db/migrate/20220216150127_move_smiles_to_appendables.rb
Normal file
6
db/migrate/20220216150127_move_smiles_to_appendables.rb
Normal file
|
@ -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
|
Loading…
Reference in a new issue