mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-01-13 05:10:59 +00:00
Migrate readings to read_marks
This commit is contained in:
parent
3a4aa11d84
commit
af5b4140dd
1 changed files with 8 additions and 0 deletions
8
db/migrate/20200402000314_move_readings_to_read_marks.rb
Normal file
8
db/migrate/20200402000314_move_readings_to_read_marks.rb
Normal file
|
@ -0,0 +1,8 @@
|
|||
class MoveReadingsToReadMarks < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
# execute "TRUNCATE read_marks"
|
||||
execute "INSERT INTO read_marks (readable_type, readable_id, reader_type, reader_id, timestamp)
|
||||
SELECT readable_type, readable_id, "User", user_id, updated_at
|
||||
FROM readings;"
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue