public inbox for [email protected]  
help / color / mirror / Atom feed
From: Simon Connah <[email protected]>
To: Alejandro Román <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Database migrations
Date: Sun, 14 Mar 2021 09:47:53 +0000
Message-ID: <iby1tc2lwHM4X4beq2drQsuRckTwVhESXmQOJAUXbfVyGi3TiHc0QdWM6drJ1fS0mtmFe5UtjslMOECkfBnyoqXLTW7aMHy07tBnFGrol1w=@protonmail.com> (raw)
In-Reply-To: <[email protected]>
References: <DZDT1SCFF7_nJRcZylu8tod4dlTmOX1hAuAlselavvkA4HJAFbOUPC_33W7IxDtMdbzQBPYGPN6p0N58SRHjP3D-JuI8CEyRn3xL1VF4t30=@protonmail.com>
	<[email protected]>

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Saturday, March 13th, 2021 at 22:04, Alejandro Román <[email protected]> wrote:

> Hello,
>
> > 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?
>
> It does. Actually, there is a known JS library that does exactly that: Knex.js (1). It allows you to define your SQL in plain JS (e.g. `knex.schema.createTable(‘users’, …)`). It will then keep track of which migrations (JS files) have been ran and which need to be run. It stores this metadata in a table called “migrations” (you can configure the exact name).
>
> (1) http://knexjs.org/#Migrations
>
> Best wishes,
>
> Alejandro

Hi Alejandro,

Thank you for the information. I'll read through the documentation for that as well. Having everything in JavaScript would be quite helpful in the long run I think but I do like the idea of extensions as well. I'll do some testing and see which option works out best.

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: <iby1tc2lwHM4X4beq2drQsuRckTwVhESXmQOJAUXbfVyGi3TiHc0QdWM6drJ1fS0mtmFe5UtjslMOECkfBnyoqXLTW7aMHy07tBnFGrol1w=@protonmail.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