mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-01-28 20:20:46 +00:00
Truncate readmarks on migration
This commit is contained in:
parent
cd7b62a39f
commit
8cac6510da
1 changed files with 2 additions and 2 deletions
|
@ -1,8 +1,8 @@
|
||||||
class MoveReadingsToReadMarks < ActiveRecord::Migration[6.0]
|
class MoveReadingsToReadMarks < ActiveRecord::Migration[6.0]
|
||||||
def change
|
def change
|
||||||
# execute "TRUNCATE read_marks"
|
execute "TRUNCATE read_marks"
|
||||||
execute "INSERT INTO read_marks (readable_type, readable_id, reader_type, reader_id, timestamp)
|
execute "INSERT INTO read_marks (readable_type, readable_id, reader_type, reader_id, timestamp)
|
||||||
SELECT readable_type, readable_id, 'User', user_id, updated_at
|
SELECT readable_type, readable_id, 'User', user_id, updated_at
|
||||||
FROM readings;"
|
FROM readings GROUP BY readable_type, readable_id, user_id;"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue