Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 20 lines (17 sloc) 618 Bytes
#! /bin/sh
id=$1
current_year=$(date +%Y)
cat <<EOF
UPDATE riders
SET class = class + 1, version = version + 1
WHERE id = $id AND class IN (3, 6) AND YEAR(date_of_birth) < $((current_year - 45));
UPDATE riders
SET class = class + 1, version = version + 1
WHERE id = $id AND class = 5 AND YEAR(date_of_birth) < $((current_year - 12));
UPDATE riders
SET class = class - 1, version = version - 1
WHERE id = $id AND class = 12 AND YEAR(date_of_birth) < $((current_year - 18));
UPDATE riders
SET class = class - 1, version = version - 1
WHERE id = $id AND class = 13 AND YEAR(date_of_birth) < $((current_year - 16));
EOF
You can’t perform that action at this time.