Skip to content

fixing somes issues due to DTO, migrations of models db#32

Merged
evanhgs merged 11 commits intomasterfrom
dev
Aug 30, 2025
Merged

fixing somes issues due to DTO, migrations of models db#32
evanhgs merged 11 commits intomasterfrom
dev

Conversation

@evanhgs
Copy link
Copy Markdown
Owner

@evanhgs evanhgs commented Aug 30, 2025

This pull request introduces several improvements and refactorings across the codebase, focusing on database migrations, comment and like API endpoints, and websocket connection management. The major themes are enhanced schema migration practices, improved API response consistency, and the addition of a generic websocket connection manager.

Database migrations and schema updates:

  • Added Alembic migration scripts to introduce an updated_at column to the message table, and updated the Alembic environment to use the correct database URL from settings. [1] [2] [3] [4]
  • Updated the Message model to include the new updated_at field with a default value.

API endpoint refactoring for comments and likes:

  • Refactored comment endpoints in comment.py to use new DTO response models, added user information to responses, improved error handling, and implemented a new PATCH endpoint for editing comments. [1] [2] [3] [4] [5] [6]
  • Refactored like endpoints in like.py to use DTOs, improved response consistency, and enhanced liked posts retrieval with author information. [1] [2] [3] [4] [5]

Websocket connection management:

  • Added a generic ConnectionManager class to utils.py for managing websocket connections, including connect, disconnect, personal messaging, and broadcasting. [1] [2]

Routing and integration:

  • Registered the new message router in main.py to enable message-related API endpoints. [1] [2]

These changes collectively improve the maintainability, consistency, and scalability of the codebase.

@evanhgs evanhgs self-assigned this Aug 30, 2025
@evanhgs evanhgs added the fix This doesn't work and know its fix, better ;) label Aug 30, 2025
@evanhgs evanhgs merged commit 82a325e into master Aug 30, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix This doesn't work and know its fix, better ;)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant