| From: | Steve Baldwin <steve(dot)baldwin(at)gmail(dot)com> | 
|---|---|
| To: | Simon Connah <simon(dot)n(dot)connah(at)protonmail(dot)com> | 
| Cc: | "pgsql-novice(at)lists(dot)postgresql(dot)org" <pgsql-novice(at)lists(dot)postgresql(dot)org> | 
| Subject: | Re: Database migrations | 
| Date: | 2021-03-13 23:19:35 | 
| Message-ID: | CAKE1Aiaugj0qJsx6rTaTiB67bWdgSvK5ZvsV9=7UHag61tJ1UQ@mail.gmail.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-novice | 
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 <simon(dot)n(dot)connah(at)protonmail(dot)com>
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.
>
>
>
>
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Simon Connah | 2021-03-14 09:40:05 | Re: Database migrations | 
| Previous Message | Alejandro Román | 2021-03-13 22:04:55 | Re: Database migrations |