3 ms·
I use SQL migrations for this, works fine. Only migrate up, never down, and store the name of migrations already run in the db.
by grey-area 9y ago
I use SQL migrations for this, works fine. Only migrate up, never down, and store the name of migrations already run in the db.
- binarray2000 9y agoCould you please clarify. Which one of these do you mean (first three results when googling SQL migrations): (1) https://www.npmjs.com/package/sql-migrations https://www.npmjs.com/package/sql-migrations (2) https://flywaydb.org/documentation/migration/sql https://flywaydb.org/documentation/migration/sql (3) https://github.com/rubenv/sql-migrate https://github.com/rubenv/sql-migrate
- grey-area 9y agoNone of the above, sorry I didn't mean a tool called 'sql migrations' I meant I simply use sql files (rather than having a special language or config file that translates to sql which is another common approach). I use something I wrote myself (see link in other comment). Nothing fancy and could be replicated easily - save sql files for migrations, run migration if not in db already, then store in the db the name of the migration run.