Skip to content

Migrate to UUID from PostgreSQL's serial auto incrementing ID #3

@myndaaa

Description

@myndaaa

Currently, the SQLAlchemy models use Integer as the primary key (id) for most tables, including sensitive user-facing ones like User, Playlist, Song, etc. This exposes internal sequence and can lead to security/privacy concerns when surfaced in public APIs (e.g., GET /users/17).

Replacing id: Integer with UUID:

  • Changing primary keys to UUID(as_uuid=True) using default=uuid.uuid4.
  • Updating Alembic migrations, Pydantic schemas, and CRUD logic accordingly.
  • Benefits: no ID guessing.

Metadata

Metadata

Assignees

Labels

help wantedExtra attention is neededquestionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions