Skip to content
This repository was archived by the owner on Jun 7, 2022. It is now read-only.

barelyhuman/grator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grator

Simple Utility To Run Migrations With A Retry

If you like any of my work, you can support me on: https://barelyhuman.dev/donate

Motivation

A few services generate their own migrations for us to use but the order of these migration queries are often invalid and never migrate properly and cause a lot of issues when needed. The cli utility simply goes through the set of queries and runs them with retry attempts to make sure each statement is run at least 3 times. In the future you can obviously change this number.

Features

  • Knex compatible so work with any connector, as long as the files also support the same

Installation

npm i -g @barelyhuman/grator

Usage

Requirements

  • A json config file named grator.json or anything as long as you point to it with the needed flag
  • A folder named migrations or any other folder with an up.sql and a down.sql file based on requirement
Usage
	$ grator [up|down]

	Options
	  --config, -c configuration file [Default: ./grator.json]
	  --directory, -d  migrations directory, should contain up.sql and down.sql [Default: ./migrations]

	Examples
	  $ grator up -c grator.json	
	  $ grator down -c grator.json -d migrations

License

MIT © Reaper

About

Simple migration file runner

Resources

License

Stars

Watchers

Forks

Sponsor this project