Skip to content

Commit

Permalink
CV2-2648: migrate tipline requests (#1811)
Browse files Browse the repository at this point in the history
  • Loading branch information
melsawy committed Feb 28, 2024
1 parent ece40f5 commit 1050ddf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 0 additions & 3 deletions db/migrate/20231122054128_create_tipline_requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,5 @@ def change
end
add_index :tipline_requests, [:associated_type, :associated_id]
add_index :tipline_requests, :smooch_message_id, unique: true, where: "smooch_message_id IS NOT NULL AND smooch_message_id != ''"
# Set start value for the ID
id = DynamicAnnotation::Field.where(field_name: 'smooch_data').last&.id || 0
execute "SELECT setval('tipline_requests_id_seq', #{id})" if id > 0
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ namespace :check do
last_team_id = Rails.cache.read('check:migrate:migrate_tipline_requests:team_id') || 0
unless slug.blank?
last_team_id = 0
if slug == 'custom_slugs'
puts "Type team slugs separated by comma then press enter"
print ">> "
slug = begin STDIN.gets.chomp.split(',').map{ |s| s.to_s } rescue [] end
raise "You must call rake task with team slugs" if slug.blank?
end
condition = { slug: slug }
end
failed_project_media_requests = []
Expand Down

0 comments on commit 1050ddf

Please sign in to comment.