diff --git a/test-and-deploy.yml b/test-and-deploy.yml
index c3b23a8f6621933b1829c3869412f3d127435dcb..5e1496cb8ad9bb3df6535195876ddecac4dc565e 100644
--- a/test-and-deploy.yml
+++ b/test-and-deploy.yml
@@ -60,17 +60,19 @@ variables:
   script: |
     if [[ "$CI_COMMIT_REF_NAME" == "master" ]]; then
       DBREQUIRED="yes"
-    elif [[ "$CI_COMMIT_REF_NAME" == *"[re-build-db]"* ]]; then
+    elif [[ "$CI_COMMIT_REF_NAME" == *"[PULL_DB]"* ]]; then
       DBREQUIRED="yes"
-    elif [[ "$FORCE_DB_UPDATE" == "yes" ]]; then
+    elif [[ "$PULL_DB" == "yes" ]]; then
       DBREQUIRED="yes"
     else
       ID=$(docker container ls --all -q -f name=^${COMPOSE_PROJECT_NAME}_mariadb_1$)
       if [[ ! -n ${ID} ]]; then
         DBREQUIRED="yes"
       else
-        # TODO: check if DB in container is empty.
-        echo "DB check not yet implemented"
+        TABLES=$(docker exec ${COMPOSE_PROJECT_NAME}_mariadb_1 mysql -u drupal --password=drupal -e "show tables;" drupal 2>/dev/null|grep users)
+        if [[ ! -n ${ID} ]]; then
+          DBREQUIRED="yes"
+        fi
       fi
     fi
   except: