Design and Implement Authentication & Role Tables #10

Closed
opened 2025-10-17 17:39:26 +00:00 by Rodrigo2003-PT · 0 comments
Rodrigo2003-PT commented 2025-10-17 17:39:26 +00:00 (Migrated from github.com)

PostgreSQL database schema to support the authentication system and user roles.

Tasks:

  • Define users table:
    • id (PK, UUID)
    • email (VARCHAR, Unique, Not Null)
    • password_hash (VARCHAR, Not Null)
    • full_name (VARCHAR, Not Null)
    • created_at (TIMESTAMPZ)
    • updated_at (TIMESTAMPZ)
  • Define roles table:
    • id (PK, SERIAL)
    • name (VARCHAR, Unique, Not Null)
  • Define user_roles join table:
    • user_id (FK to users.id)
    • role_id (FK to roles.id)
  • Create the database migration scripts using Alembic.
  • Create a seed script to populate the roles table with the required roles.
PostgreSQL database schema to support the authentication system and user roles. ### Tasks: - **Define `users` table**: - `id` (PK, UUID) - `email` (VARCHAR, Unique, Not Null) - `password_hash` (VARCHAR, Not Null) - `full_name` (VARCHAR, Not Null) - `created_at` (TIMESTAMPZ) - `updated_at` (TIMESTAMPZ) - **Define `roles` table**: - `id` (PK, SERIAL) - `name` (VARCHAR, Unique, Not Null) - **Define `user_roles` join table**: - `user_id` (FK to `users.id`) - `role_id` (FK to `roles.id`) - Create the database migration scripts using Alembic. - Create a seed script to populate the `roles` table with the required roles.
Sign in to join this conversation.
No description provided.