Skip to content

Create GitHub Actions workflow to Regenerate DB types on schema change #93

@nourshoreibah

Description

@nourshoreibah

User Story

As a developer, I want database types to automatically regenerate when the schema changes

Description

Currently, we manually regenerate database types (db-types.d.ts) for each lambda when the database schema changes. This is error-prone and easy to forget, leading to type mismatches between our code and the actual database schema.

This ticket is to set up CI/CD that automatically regenerates the db-types.d.ts file for every lambda whenever the database schema changes.

Acceptance criteria

  • Create GitHub Actions workflow that triggers on changes to apps/backend/db/db_setup.sql
  • Workflow runs kysely-codegen to regenerate types for all lambdas (users, projects, donors, expenditures, reports, auth)
  • Generated db-types.d.ts files are committed back to the repository automatically
  • Workflow fails if there are type generation errors
  • Test the workflow by making a schema change and verifying types are regenerated
  • Document process in apps/backend/db/README.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions