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 database schema #12

Merged
merged 2 commits into from
Mar 16, 2024
Merged

Refactor database schema #12

merged 2 commits into from
Mar 16, 2024

Conversation

kahlstrm
Copy link
Contributor

@kahlstrm kahlstrm commented Mar 15, 2024

This PR refactors the database schema as discussed and does other things.
The changes:

  • Remove the parties table, have the addresses table, and store recipient information (name, email, and IBAN) on the invoices instead.
  • Remove the due_date field from Invoice, as we do not want to implement it yet (it needs to be discussed with the treasurer, etc.)
  • Adds sane defaults for fields such as invoice_status and creation_time.
  • Cleans up some database fetching functions now that we don't need to join invoices and addresses for the list endpoint.

@kahlstrm kahlstrm self-assigned this Mar 15, 2024
@kahlstrm kahlstrm requested a review from lajp as a code owner March 15, 2024 00:04
Copy link
Member

@lajp lajp left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, as discussed this is a very welcome change and it's good to be done early on so that the required refactoring is only minor.

I left some comments I'd like you to address before merge

migrations/2024-01-22-103957_init/up.sql Show resolved Hide resolved
src/database/invoices.rs Show resolved Hide resolved
src/tests/invoices.rs Show resolved Hide resolved
@lajp lajp linked an issue Mar 16, 2024 that may be closed by this pull request
@lajp lajp merged commit ab25407 into main Mar 16, 2024
8 checks passed
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.

perf: Make the UNIQUE CONSTRAINT in parties lighter
2 participants