DB updates after actually updating prod

This commit is contained in:
Seth Call 2025-06-14 10:02:18 -05:00
parent dcdf9e55a3
commit 51ed748013
1 changed files with 9 additions and 6 deletions

View File

@ -7,7 +7,10 @@
execute "ALTER TABLE users ADD COLUMN profile_complete_reminder2_sent_at TIMESTAMP"
execute "ALTER TABLE users ADD COLUMN profile_complete_reminder3_sent_at TIMESTAMP"
User.where('users.id IN (SELECT player_id FROM musicians_instruments) OR users.id IN (SELECT player_id FROM genre_players)').update_all(profile_completed_at: Time.now)
User.find_each(batch_size:100) do |user|
User.where(id:user.id).update_all(profile_completed_at: Time.now)
end
#User.where('users.id IN (SELECT player_id FROM musicians_instruments) OR users.id IN (SELECT player_id FROM genre_players)').update_all(profile_completed_at: Time.now)
end
def self.down
execute "ALTER TABLE users DROP COLUMN profile_completed_at"
@ -17,10 +20,10 @@
end
end
=begin
ALTER TABLE users ADD COLUMN profile_completed_at TIMESTAMP
CREATE INDEX index_users_on_profile_completed_at ON users USING btree (profile_completed_at)
ALTER TABLE users ADD COLUMN profile_complete_reminder1_sent_at TIMESTAMP
ALTER TABLE users ADD COLUMN profile_complete_reminder2_sent_at TIMESTAMP
ALTER TABLE users ADD COLUMN profile_complete_reminder3_sent_at TIMESTAMP
ALTER TABLE users ADD COLUMN profile_completed_at TIMESTAMP;
CREATE INDEX index_users_on_profile_completed_at ON users USING btree (profile_completed_at);
ALTER TABLE users ADD COLUMN profile_complete_reminder1_sent_at TIMESTAMP;
ALTER TABLE users ADD COLUMN profile_complete_reminder2_sent_at TIMESTAMP;
ALTER TABLE users ADD COLUMN profile_complete_reminder3_sent_at TIMESTAMP;
UPDATE users set profile_completed_at=NOW() WHERE users.id IN (SELECT player_id FROM musicians_instruments) OR users.id IN (SELECT player_id FROM genre_players);
end