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

PG-MIGRATION: Replace all CASE statements #2605

Open
6 tasks
Tracked by #2610
njaeggi opened this issue May 13, 2024 · 0 comments
Open
6 tasks
Tracked by #2610

PG-MIGRATION: Replace all CASE statements #2605

njaeggi opened this issue May 13, 2024 · 0 comments
Assignees
Labels

Comments

@njaeggi
Copy link
Contributor

njaeggi commented May 13, 2024

CASE statements (mostly used in ORDER BY in our case) make queries more difficult to migrate. When a query uses DISTINCT and and CASE statement we are forced to use GROUP BY.

To prevent using GROUP BY and aggregate functions we want to remove all CASE statements in our queries and simplify our sort approach with other solutions.

ToDo

  • Add generated sort_name column to person
  • Adjust order_by_name method in person model to use new sort_name column
  • Add new table event_role_types
  • Seed Event::role_types on app start
  • Check for changes in Event model to prevent seeding role_types every app start
  • Replace other CASE statements
@njaeggi njaeggi self-assigned this May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant