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

10 lines
194 B

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