How to run DB migrations in CICD Pipeline

This page summarizes the projects mentioned and recommended in the original post on /r/ExperiencedDevs

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • Flyway

    Flyway by Redgate • Database Migrations Made Easy.

  • We use https://flywaydb.org/. You can do the migration before or during service start-up. We do it during.

  • execa

    Process execution for humans

  • Hello, this is an interesting problem. At https://stacktape.com (where we're creating a developer-friendly abstraction of AWS), we're recommending 2 options: - use a "deployment script" (basically a custom-resource lambda function that runs during the CloudFormation deployment). You can install prisma into it, and then execute the migration command from the lambda function using something like execa, if you're using Javascript/Typescript. You can easily do this with Stacktape anytime. - use a bastion (EC2) instance (deployed to the the VPC where your RDS db is). The cheapest instances cost ~4.5$/month, so it shoudln't be too costly. You can also securely connect to it using EC2 instance connect, that leverages IAM to grant permissions to connect to it. (this is something we're currently implementing as Stacktape, and will be ready in ~2 weeks).

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts