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

refactor: use postgres #96

Merged
merged 8 commits into from
Aug 14, 2024
Merged

refactor: use postgres #96

merged 8 commits into from
Aug 14, 2024

Conversation

limwa
Copy link
Member

@limwa limwa commented Aug 13, 2024

Changes the RDBMS to be PostgreSQL. Needed for niployments.

@thePeras
Copy link
Member

uow, well done!

Don't forget to update the README about the phpmyadmin and ports changes.

Do the same data.sql file works without changes?

django/etc/pgdg.sh Outdated Show resolved Hide resolved
@limwa
Copy link
Member Author

limwa commented Aug 13, 2024

Don't forget to update the README about the phpmyadmin and ports changes.

Will do! Done!

Do the same data.sql file works without changes?

No, booleans in MySQL are represented using 1 and 0. In postgres, they take the values TRUE and FALSE. Unfortunately, I'm not sure I have the availability to change the scraper on my own to apply these changes. It's something for the @NIAEFEUP/tts team, I think.

@limwa limwa marked this pull request as draft August 13, 2024 22:07
@limwa
Copy link
Member Author

limwa commented Aug 13, 2024

I've updated the schema to reflect what is created in the DB when using the models generated by the MySQL version. Currently an error is being thrown when using the data dump on the drive.
image

'B' is being used in the year field. Were fields removed/added to the schema, that are outdated in the data dump?

@limwa
Copy link
Member Author

limwa commented Aug 13, 2024

New error
image

@tomaspalma
Copy link
Member

New error image

This is because in the auto generated schema, the primary key of course_metadata was only one attribute when it should contain 3, that is why it was giving that error.

There other 2 tables with that same error. I fixed it and pushed.

I've tested locally and even with the frontend (although I needed to change the frontend year to 2024 but that is expected and good behaviour) and it was working correctly, even with the mysql dump!

@limwa limwa marked this pull request as ready for review August 14, 2024 21:23
Copy link
Member

@tomaspalma tomaspalma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@limwa limwa merged commit 7e41610 into develop Aug 14, 2024
@thePeras thePeras deleted the refactor/postgres branch August 16, 2024 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants