FIX: Missing events for ReviewableUser migration
This commit is contained in:
parent
fdaf17ec7c
commit
a282ade9c6
|
@ -12,6 +12,25 @@ class CreateReviewableHistories < ActiveRecord::Migration[5.2]
|
||||||
add_index :reviewable_histories, :reviewable_id
|
add_index :reviewable_histories, :reviewable_id
|
||||||
|
|
||||||
# Migrate Created ReviewableUser History
|
# Migrate Created ReviewableUser History
|
||||||
|
execute(<<~SQL)
|
||||||
|
INSERT INTO reviewable_histories (
|
||||||
|
reviewable_id,
|
||||||
|
reviewable_history_type,
|
||||||
|
status,
|
||||||
|
created_by_id,
|
||||||
|
created_at,
|
||||||
|
updated_at
|
||||||
|
)
|
||||||
|
SELECT r.id,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
r.created_by_id,
|
||||||
|
r.created_at,
|
||||||
|
r.created_at
|
||||||
|
FROM reviewables AS r
|
||||||
|
WHERE r.type = 'ReviewableUser'
|
||||||
|
SQL
|
||||||
|
|
||||||
execute(<<~SQL)
|
execute(<<~SQL)
|
||||||
INSERT INTO reviewable_histories (
|
INSERT INTO reviewable_histories (
|
||||||
reviewable_id,
|
reviewable_id,
|
||||||
|
|
Loading…
Reference in New Issue