Project consistency and Mapped syntax for SQLAlchemy #27

Open
irl wants to merge 2 commits from irl/cloud-api:mapped into main
Owner
  • Adds BSD-2-clause licence
  • Moves .alembic to alembic (no need for this to be hidden, consistency with other projects)
  • Rename Base to CustomBase and move into models.py (consistency)
  • Update all columns to be defined using Mapped syntax
  • Update CustomBase to include overrides for datetime (use timezone) and for dict[str, Any] (gets turned into JSON type)
  • Some unique constraints are removed, some of those are security issues
    • Someone trying to sign up and create a new organisation can test to see if an organisation name already exists if that's unique
  • There are going to be cases (e.g. GDPR requests) where we need to delete data for real, but in most cases we want to soft delete, https://guardianproject.dev/sr2/snapdirect/src/branch/main/src/models.py#L21
* Adds BSD-2-clause licence * Moves .alembic to alembic (no need for this to be hidden, consistency with other projects) * Rename Base to CustomBase and move into models.py (consistency) * Update all columns to be defined using Mapped syntax * Update CustomBase to include overrides for datetime (use timezone) and for dict[str, Any] (gets turned into JSON type) * Some unique constraints are removed, some of those are security issues * Someone trying to sign up and create a new organisation can test to see if an organisation name already exists if that's unique * There are going to be cases (e.g. GDPR requests) where we need to delete data for real, but in most cases we want to soft delete, https://guardianproject.dev/sr2/snapdirect/src/branch/main/src/models.py#L21
irl added 2 commits 2026-06-20 17:50:23 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u mapped:irl-mapped
git checkout irl-mapped

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git checkout main
git merge --no-ff irl-mapped
git checkout irl-mapped
git rebase main
git checkout main
git merge --ff-only irl-mapped
git checkout irl-mapped
git rebase main
git checkout main
git merge --no-ff irl-mapped
git checkout main
git merge --squash irl-mapped
git checkout main
git merge --ff-only irl-mapped
git checkout main
git merge irl-mapped
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: sr2/cloud-api#27
No description provided.