public inbox for [email protected]  
help / color / mirror / Atom feed
From: Steve Baldwin <[email protected]>
To: Simon Connah <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Database migrations
Date: Sun, 14 Mar 2021 10:19:35 +1100
Message-ID: <CAKE1Aiaugj0qJsx6rTaTiB67bWdgSvK5ZvsV9=7UHag61tJ1UQ@mail.gmail.com> (raw)
In-Reply-To: <DZDT1SCFF7_nJRcZylu8tod4dlTmOX1hAuAlselavvkA4HJAFbOUPC_33W7IxDtMdbzQBPYGPN6p0N58SRHjP3D-JuI8CEyRn3xL1VF4t30=@protonmail.com>
References: <DZDT1SCFF7_nJRcZylu8tod4dlTmOX1hAuAlselavvkA4HJAFbOUPC_33W7IxDtMdbzQBPYGPN6p0N58SRHjP3D-JuI8CEyRn3xL1VF4t30=@protonmail.com>

Hi Simon,

Another option (and the one we use) is a tool called flyway -
https://flywaydb.org/. There is a free community edition, and it is pretty
comprehensive. There are docker images you can use during ci.

Flyway supports versioned (run once) migrations, repeatable (run when
changed) migrations, and a bunch more.

Other than being a user of the community edition, I have no association
with flyway.

Cheers,

Steve

On Sun, Mar 14, 2021 at 8:40 AM Simon Connah <[email protected]>
wrote:

> Hi,
>
> I'm sorry if this is a rather stupid question but I'm fairly new to
> databases and was wondering if anyone could offer some advice?
>
> I have an app I am developing using Node.js and PostgreSQL 13.2. I have
> the basic tables I want to start with but I know that as development
> progresses change is going to be required. Since this is an open-source
> project people are going to want to upgrade from one version to the next
> and that might require changes to the database structure. What is the best
> way to handle this?
>
> I was thinking about just having a bunch of SQL files with a version
> number and date and applying them to the database from oldest to newest
> (with a table storing information for files that have already been
> processed). Does this sound like a reasonable solution?
>
> If not could someone point me in the right direction, please?
>
> Thank you for your help.
>
> Simon.
>
>
>
>
>


view thread (7+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Database migrations
  In-Reply-To: <CAKE1Aiaugj0qJsx6rTaTiB67bWdgSvK5ZvsV9=7UHag61tJ1UQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox