agnyz / the-bed-stack

Bun + ElysiaJS + DrizzleORM = the stack you don't want to sleep on 🛌💤
https://agnyz.github.io/the-bed-stack/
MIT License
39 stars 3 forks source link

Dev Container must be rebuilt every time it is built #55

Open yamcodes opened 1 year ago

yamcodes commented 1 year ago

Version

latest

Describe the bug

Dev Container must be rebuilt every time it is built.

This is an effect of an issue where the current container build process does not properly create the database.

Reproduction

  1. Start the codebase in a container locally with the Dev Containers extension or in a GitHub Codespace.
  2. Wait for it to load completely, try migrating the schema to the database with db:migrate
  3. You will encounter an error similar to the one below:
    $ bun db/migrations/migrate.ts
    1 | export class PostgresError extends Error {
    2 |   constructor(x) {
    3 |     super(x.message)
    4 |     this.name = this.constructor.name
          ^
    PostgresError: database "medium" does not exist
  4. Press cmd+p > Dev Containers: Rebuild Container, repeat step 2-3
  5. You will notice that migrations work successfully.

System Info

No response

Validations