Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database migrations #5

Open
davidthor opened this issue May 22, 2023 · 0 comments
Open

Database migrations #5

davidthor opened this issue May 22, 2023 · 0 comments
Labels
components Issues related to creating components enhancement New feature or request

Comments

@davidthor
Copy link
Member

davidthor commented May 22, 2023

Database migrations are an important features allowing applications to declare the table structure they expect a database to have before they can start writing content to it. Applications can execute these migrations at startup, but this can be risky for large scale environments with multiple replicas. Each may try to run migrations which can create collisions, race conditions, and otherwise ugly behavior.

In this ticket, we'll introduce the migrate field to the databases schema that will tell architect to run the migrate task after the database is available and before other applications can connect to it. This field will support all the same values as "cronjobs" minus the "schedule" field.

databases:
  main:
    type: postgres:13
    migrate:
      image: my-docker-image:latest
      command: npm run migrate
      environment:
        DB_DSN: ${{ databases.main.url }}
@davidthor davidthor added this to the v0.2 - Lifecycle hooks milestone May 22, 2023
@davidthor davidthor added enhancement New feature or request components Issues related to creating components labels Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
components Issues related to creating components enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant