__mysql_database: carry over state

This commit is contained in:
ander 2020-01-03 18:26:11 +02:00
parent 9a693537f4
commit 24862e0208

View file

@ -37,8 +37,16 @@ then
database="$__object_id"
fi
__mysql_user "$user" --password "$password"
state_should="$( cat "$__object/parameter/state" )"
__mysql_user "$user" \
--password "$password" \
--state "$state_should"
# removing user should remove all user's privileges
require="__mysql_user/$user" \
__mysql_privileges "$database/$user" --database "$database" --user "$user"
__mysql_privileges "$database/$user" \
--database "$database" \
--user "$user" \
--state "$state_should"
fi