Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lLC0E-0007is-3N for pgsql-novice@arkaria.postgresql.org; Sat, 13 Mar 2021 21:40:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lLC0D-0003sT-1F for pgsql-novice@arkaria.postgresql.org; Sat, 13 Mar 2021 21:40:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lLC0C-0003r5-PE for pgsql-novice@lists.postgresql.org; Sat, 13 Mar 2021 21:40:52 +0000 Received: from mail1.protonmail.ch ([185.70.40.18]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lLC09-0001eh-AM for pgsql-novice@lists.postgresql.org; Sat, 13 Mar 2021 21:40:52 +0000 Date: Sat, 13 Mar 2021 21:40:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1615671645; bh=NA67N8n1L/f1seg4oLk+mt1/sWrxE8QtHMvZkE70H8w=; h=Date:To:From:Reply-To:Subject:From; b=rJguN6kfWsTkVVfhYq+heGYLhPa5KZRkAiKUbwEctkHyIdJyDHQ+6VYXF5tzgcDbN 2AlihakXZhWEepbX3aJwxCjF50KFZCpMZfGMGWndmsKlFJf4JOsI+hBOxva2ripAKq LK0fUPsC6jnS0fGiYfOtnuMX7TR4T5Hi//lJm7pM= To: "pgsql-novice@lists.postgresql.org" From: Simon Connah Reply-To: Simon Connah Subject: Database migrations Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, I'm sorry if this is a rather stupid question but I'm fairly new to databas= es 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 progresse= s change is going to be required. Since this is an open-source project peop= le 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 t= able 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.