Project consistency and Mapped syntax for SQLAlchemy #27

Merged
chris merged 2 commits from irl/cloud-api:mapped into main 2026-06-22 08:19:08 +00:00
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
chris merged commit 55927946c7 into main 2026-06-22 08:19:08 +00:00
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.