Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
24 changes: 11 additions & 13 deletions app/models/signup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@
#
# Table name: signups
#
# id :bigint not null, primary key
# bucket_key :string
# counted :boolean
# expires_at :datetime
# requested_bucket_key :string
# state :string default("confirmed"), not null
# created_at :datetime not null
# updated_at :datetime not null
# bucket_id :bigint
# requested_bucket_id :bigint
# run_id :bigint not null
# updated_by_id :bigint
# user_con_profile_id :bigint not null
# id :bigint not null, primary key
# counted :boolean
# expires_at :datetime
# state :string default("confirmed"), not null
# created_at :datetime not null
# updated_at :datetime not null
# bucket_id :bigint
# requested_bucket_id :bigint
# run_id :bigint not null
# updated_by_id :bigint
# user_con_profile_id :bigint not null
#
# Indexes
#
Expand Down
2 changes: 0 additions & 2 deletions app/models/signup_change.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
#
# id :bigint not null, primary key
# action :string not null
# bucket_key :string
# bucket_name :string
# counted :boolean
# requested_bucket_key :string
# requested_bucket_name :string
# state :string not null
# created_at :datetime not null
Expand Down
1 change: 0 additions & 1 deletion app/models/signup_ranked_choice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# id :bigint not null, primary key
# prioritize_waitlist :boolean default(FALSE), not null
# priority :integer not null
# requested_bucket_key :string
# state :string not null
# waitlist_position_cap :integer
# created_at :datetime not null
Expand Down
21 changes: 10 additions & 11 deletions app/models/signup_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
#
# Table name: signup_requests
#
# id :bigint not null, primary key
# requested_bucket_key :string
# state :string default("pending"), not null
# created_at :datetime not null
# updated_at :datetime not null
# replace_signup_id :bigint
# requested_bucket_id :bigint
# result_signup_id :bigint
# target_run_id :bigint not null
# updated_by_id :bigint
# user_con_profile_id :bigint not null
# id :bigint not null, primary key
# state :string default("pending"), not null
# created_at :datetime not null
# updated_at :datetime not null
# replace_signup_id :bigint
# requested_bucket_id :bigint
# result_signup_id :bigint
# target_run_id :bigint not null
# updated_by_id :bigint
# user_con_profile_id :bigint not null
#
# Indexes
#
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# frozen_string_literal: true
class DropBucketKeyColumnsFromSignupsSignupRequestsSignupRankedChoicesAndSignupChanges < ActiveRecord::Migration[8.1]
def change
reversible do |dir|
dir.up { remove_check_constraint :signups, name: "bucket_key_null_for_non_slot_occupying_states" }

dir.down do
add_check_constraint :signups,
"(bucket_key IS NULL) OR ((state)::text = ANY (ARRAY['confirmed'::text, 'ticket_purchase_hold'::text]))", # rubocop:disable Layout/LineLength
name: "bucket_key_null_for_non_slot_occupying_states"
end
end

change_table :signups, bulk: true do |t|
t.remove :bucket_key, type: :string
t.remove :requested_bucket_key, type: :string
end

remove_column :signup_requests, :requested_bucket_key, :string

remove_column :signup_ranked_choices, :requested_bucket_key, :string

change_table :signup_changes, bulk: true do |t|
t.remove :bucket_key, type: :string
t.remove :requested_bucket_key, type: :string
end
end
end
16 changes: 5 additions & 11 deletions db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2403,9 +2403,7 @@ CREATE TABLE public.signup_changes (
bucket_id bigint,
bucket_name character varying,
requested_bucket_id bigint,
requested_bucket_name character varying,
requested_bucket_key character varying,
bucket_key character varying
requested_bucket_name character varying
);


Expand Down Expand Up @@ -2445,8 +2443,7 @@ CREATE TABLE public.signup_ranked_choices (
result_signup_request_id bigint,
prioritize_waitlist boolean DEFAULT false NOT NULL,
waitlist_position_cap integer,
requested_bucket_id bigint,
requested_bucket_key character varying
requested_bucket_id bigint
);


Expand Down Expand Up @@ -2483,8 +2480,7 @@ CREATE TABLE public.signup_requests (
updated_by_id bigint,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
requested_bucket_id bigint,
requested_bucket_key character varying
requested_bucket_id bigint
);


Expand Down Expand Up @@ -2562,10 +2558,7 @@ CREATE TABLE public.signups (
expires_at timestamp without time zone,
bucket_id bigint,
requested_bucket_id bigint,
requested_bucket_key character varying,
bucket_key character varying,
CONSTRAINT bucket_id_null_for_non_slot_occupying_states CHECK (((bucket_id IS NULL) OR ((state)::text = ANY (ARRAY['confirmed'::text, 'ticket_purchase_hold'::text])))),
CONSTRAINT bucket_key_null_for_non_slot_occupying_states CHECK (((bucket_key IS NULL) OR ((state)::text = ANY (ARRAY['confirmed'::text, 'ticket_purchase_hold'::text]))))
CONSTRAINT bucket_id_null_for_non_slot_occupying_states CHECK (((bucket_id IS NULL) OR ((state)::text = ANY (ARRAY['confirmed'::text, 'ticket_purchase_hold'::text]))))
);


Expand Down Expand Up @@ -6191,6 +6184,7 @@ ALTER TABLE ONLY public.cms_files_pages
SET search_path TO "$user", public;

INSERT INTO "schema_migrations" (version) VALUES
('20260805191230'),
('20260803190446'),
('20260716155031'),
('20260615192952'),
Expand Down
1 change: 0 additions & 1 deletion test/factories/signup_ranked_choices.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# id :bigint not null, primary key
# prioritize_waitlist :boolean default(FALSE), not null
# priority :integer not null
# requested_bucket_key :string
# state :string not null
# waitlist_position_cap :integer
# created_at :datetime not null
Expand Down
21 changes: 10 additions & 11 deletions test/factories/signup_requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
#
# Table name: signup_requests
#
# id :bigint not null, primary key
# requested_bucket_key :string
# state :string default("pending"), not null
# created_at :datetime not null
# updated_at :datetime not null
# replace_signup_id :bigint
# requested_bucket_id :bigint
# result_signup_id :bigint
# target_run_id :bigint not null
# updated_by_id :bigint
# user_con_profile_id :bigint not null
# id :bigint not null, primary key
# state :string default("pending"), not null
# created_at :datetime not null
# updated_at :datetime not null
# replace_signup_id :bigint
# requested_bucket_id :bigint
# result_signup_id :bigint
# target_run_id :bigint not null
# updated_by_id :bigint
# user_con_profile_id :bigint not null
#
# Indexes
#
Expand Down
24 changes: 11 additions & 13 deletions test/factories/signups.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@
#
# Table name: signups
#
# id :bigint not null, primary key
# bucket_key :string
# counted :boolean
# expires_at :datetime
# requested_bucket_key :string
# state :string default("confirmed"), not null
# created_at :datetime not null
# updated_at :datetime not null
# bucket_id :bigint
# requested_bucket_id :bigint
# run_id :bigint not null
# updated_by_id :bigint
# user_con_profile_id :bigint not null
# id :bigint not null, primary key
# counted :boolean
# expires_at :datetime
# state :string default("confirmed"), not null
# created_at :datetime not null
# updated_at :datetime not null
# bucket_id :bigint
# requested_bucket_id :bigint
# run_id :bigint not null
# updated_by_id :bigint
# user_con_profile_id :bigint not null
#
# Indexes
#
Expand Down
2 changes: 0 additions & 2 deletions test/models/signup_change_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
#
# id :bigint not null, primary key
# action :string not null
# bucket_key :string
# bucket_name :string
# counted :boolean
# requested_bucket_key :string
# requested_bucket_name :string
# state :string not null
# created_at :datetime not null
Expand Down
1 change: 0 additions & 1 deletion test/models/signup_ranked_choice_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# id :bigint not null, primary key
# prioritize_waitlist :boolean default(FALSE), not null
# priority :integer not null
# requested_bucket_key :string
# state :string not null
# waitlist_position_cap :integer
# created_at :datetime not null
Expand Down
21 changes: 10 additions & 11 deletions test/models/signup_request_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
#
# Table name: signup_requests
#
# id :bigint not null, primary key
# requested_bucket_key :string
# state :string default("pending"), not null
# created_at :datetime not null
# updated_at :datetime not null
# replace_signup_id :bigint
# requested_bucket_id :bigint
# result_signup_id :bigint
# target_run_id :bigint not null
# updated_by_id :bigint
# user_con_profile_id :bigint not null
# id :bigint not null, primary key
# state :string default("pending"), not null
# created_at :datetime not null
# updated_at :datetime not null
# replace_signup_id :bigint
# requested_bucket_id :bigint
# result_signup_id :bigint
# target_run_id :bigint not null
# updated_by_id :bigint
# user_con_profile_id :bigint not null
#
# Indexes
#
Expand Down
24 changes: 11 additions & 13 deletions test/models/signup_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@
#
# Table name: signups
#
# id :bigint not null, primary key
# bucket_key :string
# counted :boolean
# expires_at :datetime
# requested_bucket_key :string
# state :string default("confirmed"), not null
# created_at :datetime not null
# updated_at :datetime not null
# bucket_id :bigint
# requested_bucket_id :bigint
# run_id :bigint not null
# updated_by_id :bigint
# user_con_profile_id :bigint not null
# id :bigint not null, primary key
# counted :boolean
# expires_at :datetime
# state :string default("confirmed"), not null
# created_at :datetime not null
# updated_at :datetime not null
# bucket_id :bigint
# requested_bucket_id :bigint
# run_id :bigint not null
# updated_by_id :bigint
# user_con_profile_id :bigint not null
#
# Indexes
#
Expand Down