Database migrations

From: Simon Connah <simon(dot)n(dot)connah(at)protonmail(dot)com>
To: "pgsql-novice(at)lists(dot)postgresql(dot)org" <pgsql-novice(at)lists(dot)postgresql(dot)org>
Subject: Database migrations
Date: 2021-03-13 21:40:27
Message-ID: DZDT1SCFF7_nJRcZylu8tod4dlTmOX1hAuAlselavvkA4HJAFbOUPC_33W7IxDtMdbzQBPYGPN6p0N58SRHjP3D-JuI8CEyRn3xL1VF4t30=@protonmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2021-03-13 21:58:35 Re: Database migrations
Previous Message Narendra Joshi 2021-03-07 18:15:18 Re: LEFT or RIGHT JOIN - can't see where I'm going wrong?