diff --git a/admin/app/admin/affiliates.rb b/admin/app/admin/affiliates.rb index 868d63fce..1280fecd2 100644 --- a/admin/app/admin/affiliates.rb +++ b/admin/app/admin/affiliates.rb @@ -6,13 +6,13 @@ ActiveAdmin.register JamRuby::AffiliatePartner, :as => 'Affiliates' do config.batch_actions = false # config.clear_action_items! config.filters = true - config.per_page = 50 + config.per_page = 100 config.paginate = true #form :partial => 'form' - filter :partner_user + #filter :partner_user filter :partner_name filter :id diff --git a/ruby/db/migrate/20250322000000_affiliate_tracking_totals.rb b/ruby/db/migrate/20250322000000_affiliate_tracking_totals.rb index 5364944e4..6d3140c6f 100644 --- a/ruby/db/migrate/20250322000000_affiliate_tracking_totals.rb +++ b/ruby/db/migrate/20250322000000_affiliate_tracking_totals.rb @@ -22,6 +22,11 @@ class AddTrackingTotalsToAffiliatePartners < ActiveRecord::Migration execute "ALTER TABLE affiliate_quarterly_payments ADD COLUMN subscription_due_amount_in_cents INTEGER NOT NULL DEFAULT 0" execute "ALTER TABLE affiliate_monthly_payments ADD COLUMN jamtrack_due_amount_in_cents INTEGER NOT NULL DEFAULT 0" execute "ALTER TABLE affiliate_monthly_payments ADD COLUMN subscription_due_amount_in_cents INTEGER NOT NULL DEFAULT 0" + execute "CREATE INDEX affiliate_partner_user_id_idx ON affiliate_partners USING btree (partner_user_id);" + execute "CREATE INDEX affiliate_quarterly_payments_closed_index ON affiliate_quarterly_payments USING btree (paid);" + execute "CREATE INDEX affiliate_quarterly_payments_paid_index ON affiliate_quarterly_payments USING btree (closed);" + execute "CREATE INDEX affiliate_monthly_payments_paid_index ON affiliate_monthly_payments USING btree (closed);" + end =begin @@ -38,6 +43,10 @@ class AddTrackingTotalsToAffiliatePartners < ActiveRecord::Migration ALTER TABLE affiliate_monthly_payments ADD COLUMN subscription_due_amount_in_cents INTEGER NOT NULL DEFAULT 0; ALTER TABLE affiliate_quarterly_payments ADD COLUMN subscriptions_count INTEGER NOT NULL DEFAULT 0; ALTER TABLE affiliate_monthly_payments ADD COLUMN subscriptions_count INTEGER NOT NULL DEFAULT 0; + CREATE INDEX affiliate_partner_user_id_idx ON affiliate_partners USING btree (partner_user_id); + CREATE INDEX affiliate_quarterly_payments_closed_index ON affiliate_quarterly_payments USING btree (paid); + CREATE INDEX affiliate_quarterly_payments_paid_index ON affiliate_quarterly_payments USING btree (closed); + CREATE INDEX affiliate_monthly_payments_paid_index ON affiliate_monthly_payments USING btree (closed); =end