Skip to content

Set Up Database Module with TypeORM and Migrations #42

@Mkalbani

Description

@Mkalbani

Description

Configure a database module that bootstraps TypeORM with PostgreSQL, registers all entities, and integrates database migrations into the development and deployment workflow. A solid database setup from the start prevents painful schema drift and ensures the team can evolve the data model confidently as new modules are added.

Acceptance Criteria

  • A database module is scaffolded at src/database/
  • TypeORM is connected to PostgreSQL using env-based config
  • All entities are auto-discovered and registered via TypeOrmModule.forFeature
  • Migrations are configured and a first migration generates the initial schema
  • npm run migration:generate, migration:run, and migration:revert scripts are available
  • synchronize is set to false in all non-local environments
  • Connection failure at startup logs a clear error and exits the process
  • A seed script populates dev/test databases with sample puzzles and users

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions