You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
db-schema/next_id

9 lines
164 B

#!/bin/bash
LAST=$(\
find db_scripts/ -name "*.up" |\
awk -vFS=/ -vOFS=/ '{ print $NF }' |\
sort -n | tail -1 | cut -f1 -d'.' \
);
echo $(( LAST + 1))