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

Re-name columns named "start" and "end" #1807

Open
maneesha opened this issue Feb 19, 2021 · 4 comments
Open

Re-name columns named "start" and "end" #1807

maneesha opened this issue Feb 19, 2021 · 4 comments

Comments

@maneesha
Copy link
Contributor

maneesha commented Feb 19, 2021

Two tables in AMY use start and end as a column name. Since end is also a PostgreSQL reserved word and start is a SQL reserved word, it causes problems when running SQL queries. SQLite was more forgiving, but as PostgreSQL is stricter, this should be fixed, renaming start and end to start_date and end_date.

Tables with start and end columns:

  • extrequests_selforganisedsubmission
  • workshops_event
@pbanaszkiewicz
Copy link
Contributor

A migration and possibly quite some changes in templates required.

@maneesha maneesha changed the title Re-name columns named "end" Re-name columns named "start" and "end" Aug 9, 2021
za added a commit to za/amy that referenced this issue Oct 8, 2021
za added a commit to za/amy that referenced this issue Oct 8, 2021
za added a commit to za/amy that referenced this issue Oct 8, 2021
@maneesha
Copy link
Contributor Author

maneesha commented Apr 18, 2023

We had a community member create a PR long ago that I closed becuase I didn't think the PR does everything it needs to, and would be reluctant to merge it as it would break many of our external queries.

It makes writing SQL queries a bit annoying as we have to do something to escape the reserved words. I'm not sure if this could potentially cause other problems as well, so I would defer to @elichad and @pbanaszkiewicz on what to do next.

@pbanaszkiewicz
Copy link
Contributor

I think we can make this change, it's just a matter of finding all the places that use the old names and updating them. @maneesha Feel free to add this to the next milestone.

@pbanaszkiewicz
Copy link
Contributor

Note: we now have other models with these fields too, for example CommunityRole.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants