Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove old Registration Columns #10400

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions app/models/competition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@ class Competition < ApplicationRecord
restricted: 2,
}, prefix: true

NEW_REG_SYSTEM_DEFAULT = :v3

enum :registration_version, [:v1, :v2, :v3], prefix: true, default: NEW_REG_SYSTEM_DEFAULT

CLONEABLE_ATTRIBUTES = %w(
cityName
countryId
Expand Down
12 changes: 12 additions & 0 deletions db/migrate/20241209104407_remove_v1_columns.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

class RemoveV1Columns < ActiveRecord::Migration[7.2]
def change
remove_column :registrations, :accepted_at
remove_column :registrations, :deleted_at
remove_column :registrations, :accepted_by
remove_column :registrations, :deleted_by
remove_column :Competitions, :registration_version
drop_table :microservice_registrations
end
end
22 changes: 3 additions & 19 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_11_24_050607) do
ActiveRecord::Schema[7.2].define(version: 2024_12_09_104407) 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 @@ -81,7 +81,6 @@
t.integer "posting_by"
t.boolean "forbid_newcomers", default: false, null: false
t.string "forbid_newcomers_reason"
t.integer "registration_version", default: 0, null: false
t.index ["cancelled_at"], name: "index_Competitions_on_cancelled_at"
t.index ["countryId"], name: "index_Competitions_on_countryId"
t.index ["end_date"], name: "index_Competitions_on_end_date"
Expand Down Expand Up @@ -794,17 +793,6 @@
t.datetime "updated_at", precision: nil, null: false
end

create_table "microservice_registrations", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t|
t.string "competition_id", limit: 32, null: false
t.integer "user_id", null: false
t.text "roles"
t.boolean "is_competing", default: true, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["competition_id", "user_id"], name: "index_microservice_registrations_on_competition_id_and_user_id", unique: true
t.index ["user_id"], name: "fk_rails_dc6d05bc5e"
end

create_table "oauth_access_grants", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t|
t.integer "resource_owner_id", null: false
t.integer "application_id", null: false
Expand Down Expand Up @@ -1023,13 +1011,11 @@
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.integer "guests", default: 0, null: false
t.datetime "accepted_at", precision: nil
t.integer "accepted_by"
t.datetime "deleted_at", precision: nil
t.integer "deleted_by"
t.text "roles"
t.boolean "is_competing", default: true
t.text "administrative_notes"
t.datetime "rejected_at"
t.datetime "waitlisted_at"
FinnIckler marked this conversation as resolved.
Show resolved Hide resolved
t.string "competing_status", default: "pending", null: false
t.index ["competition_id", "user_id"], name: "index_registrations_on_competition_id_and_user_id", unique: true
t.index ["competition_id"], name: "index_registrations_on_competition_id"
Expand Down Expand Up @@ -1394,8 +1380,6 @@

add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
add_foreign_key "microservice_registrations", "Competitions", column: "competition_id", on_update: :cascade, on_delete: :cascade
add_foreign_key "microservice_registrations", "users"
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"
Expand Down
6 changes: 0 additions & 6 deletions lib/database_dumper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ def self.actions_to_column_sanitizers(columns_by_action)
competition_series_id
use_wca_live_for_scoretaking
allow_registration_without_qualification
registration_version
forbid_newcomers
forbid_newcomers_reason
),
Expand Down Expand Up @@ -571,12 +570,8 @@ def self.actions_to_column_sanitizers(columns_by_action)
column_sanitizers: actions_to_column_sanitizers(
copy: %w(
id
accepted_at
accepted_by
competition_id
created_at
deleted_at
deleted_by
guests
updated_at
user_id
Expand All @@ -591,7 +586,6 @@ def self.actions_to_column_sanitizers(columns_by_action)
},
),
}.freeze,
"microservice_registrations" => :skip_all_rows,
"registration_history_changes" => :skip_all_rows,
"registration_history_entries" => :skip_all_rows,
"waiting_lists" => {
Expand Down
2 changes: 0 additions & 2 deletions spec/factories/competitions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@
refund_policy_percent { 0 }
guests_entry_fee_lowest_denomination { 0 }

registration_version { :v3 }

trait :enforces_qualifications do
with_organizer
qualification_results { true }
Expand Down
Loading