#sql #tool #migration #up #down #file #generate

app grate

a simple cli for generating migration files

4 releases (1 stable)

1.0.0 Apr 11, 2024
0.2.0 Mar 18, 2023
0.1.1 Mar 15, 2023
0.1.0 Mar 15, 2023

#385 in Database interfaces

Download history 7/week @ 2024-02-24 1/week @ 2024-03-02 3/week @ 2024-03-09 7/week @ 2024-03-16 39/week @ 2024-03-30 137/week @ 2024-04-06 16/week @ 2024-04-13

156 downloads per month

MIT license

7KB
110 lines

grate

A simple sql migrations file gen tool

example

grate --name party --path migrations
 created ./migrations/1678912821_party.up.sql
 created ./migrations/1678912821_party.down.sql

params

  • name - required. the name of the migration, will be appended to the file name after the timestamp.
  • path - optional. defaults to ./migrations. will generate a new directory if non exists.
  • format - optional. defaults to auto. Options are auto, unix, datetime, milli, int. Determines the format of the file prefix (ie {prefix}_{name}.up.sql). When using the auto format, the tool looks into the path you supplied and finds the most recent file, then uses that convention.

Dependencies

~2.1–3MB
~52K SLoC