Skip to content

Commit aa6c047

Browse files
committed
Add a shell script that can generate ragtime migration files.
- Needs to be run from the root of the project - Run with `bin/generate-migration some-migration-name`
1 parent a0e6680 commit aa6c047

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

bin/generate-migration

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
3+
if [ $# -eq 0 ]
4+
then
5+
echo "You need to specify a migration name."
6+
fi
7+
8+
TIME=$(date +%s)
9+
NAME=$1
10+
11+
touch `pwd`/migrations/$TIME-$NAME.up.sql
12+
touch `pwd`/migrations/$TIME-$NAME.down.sql
13+
14+
echo "Migration files generated."
15+

0 commit comments

Comments
 (0)