Skip to content

Commit

Permalink
merged main
Browse files Browse the repository at this point in the history
  • Loading branch information
dunkOnIT committed Oct 31, 2024
2 parents 3f66d21 + f79c151 commit a38e1fc
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ gem 'react-rails'
gem 'sprockets-rails'
gem 'fuzzy-string-match'
gem 'sidekiq'
gem 'sidekiq-cron'
gem 'sidekiq-cron', github: 'sidekiq-cron'
gem 'after_commit_everywhere'
gem 'slack-ruby-client'
gem 'puma'
Expand Down
20 changes: 15 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ GIT
specs:
selectize-rails (0.12.1)

GIT
remote: https://github.com/sidekiq-cron/sidekiq-cron.git
revision: f0ac4038da7b3c6bc09b2c3ca9f0b9979848a95a
specs:
sidekiq-cron (2.0.0.rc2)
cronex (>= 0.13.0)
fugit (~> 1.8, >= 1.11.1)
globalid (>= 1.0.1)
sidekiq (>= 6.5.0)

GIT
remote: https://github.com/thewca/i18n-country-translations.git
revision: e6706abe0eaa65729c1acb698be08b91dd2b6fde
Expand Down Expand Up @@ -221,6 +231,9 @@ GEM
bigdecimal
rexml
crass (1.0.6)
cronex (0.15.0)
tzinfo
unicode (>= 0.4.4.5)
css_parser (1.16.0)
addressable
csv (3.3.0)
Expand Down Expand Up @@ -696,10 +709,6 @@ GEM
logger
rack (>= 2.2.4)
redis-client (>= 0.22.2)
sidekiq-cron (1.12.0)
fugit (~> 1.8)
globalid (>= 1.0.1)
sidekiq (>= 6)
signet (0.19.0)
addressable (~> 2.8)
faraday (>= 0.17.5, < 3.a)
Expand Down Expand Up @@ -762,6 +771,7 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.9.1)
unicode (0.4.4.5)
unicode-display_width (2.6.0)
uniform_notifier (1.16.0)
uri (0.13.1)
Expand Down Expand Up @@ -902,7 +912,7 @@ DEPENDENCIES
selectize-rails!
shakapacker (= 8.0.2)
sidekiq
sidekiq-cron
sidekiq-cron!
simple_form
simplecov
simplecov-lcov
Expand Down
8 changes: 8 additions & 0 deletions db/migrate/20241031120315_crr_foreign_key_cascade.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

class CrrForeignKeyCascade < ActiveRecord::Migration[7.2]
def change
remove_foreign_key :regional_records_lookup, :Results
add_foreign_key :regional_records_lookup, :Results, column: :resultId, on_update: :cascade, on_delete: :cascade
end
end
4 changes: 2 additions & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.2].define(version: 2024_10_25_161404) do
ActiveRecord::Schema[7.2].define(version: 2024_10_31_120315) do
create_table "Competitions", id: { type: :string, limit: 32, default: "" }, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t|
t.string "name", limit: 50, default: "", null: false
t.string "cityName", limit: 50, default: "", null: false
Expand Down Expand Up @@ -1350,7 +1350,7 @@
add_foreign_key "oauth_openid_requests", "oauth_access_grants", column: "access_grant_id", on_delete: :cascade
add_foreign_key "payment_intents", "users", column: "initiated_by_id"
add_foreign_key "paypal_records", "paypal_records", column: "parent_record_id"
add_foreign_key "regional_records_lookup", "Results", column: "resultId"
add_foreign_key "regional_records_lookup", "Results", column: "resultId", on_update: :cascade, on_delete: :cascade
add_foreign_key "registration_history_changes", "registration_history_entries"
add_foreign_key "sanity_check_exclusions", "sanity_checks"
add_foreign_key "sanity_checks", "sanity_check_categories"
Expand Down
2 changes: 1 addition & 1 deletion lib/check_regional_records.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def self.add_to_lookup_table(competition_id = nil, table_name: LOOKUP_TABLE_NAME
SELECT Results.id, Results.countryId, Results.eventId, Competitions.end_date, Results.best, Results.average
FROM Results
INNER JOIN Competitions ON Results.competitionId = Competitions.id
#{competition_id.present? ? "WHERE Results.competition_id = #{competition_id}" : ''}
#{competition_id.present? ? "WHERE Results.competitionId = '#{competition_id}'" : ''}
ON DUPLICATE KEY UPDATE
countryId = Results.countryId,
eventId = Results.eventId,
Expand Down

0 comments on commit a38e1fc

Please sign in to comment.