fix: database location

Founded a major mistake: db overwrites during install.  Now all scripts save db in special folder and don't overwrite it.
This commit is contained in:
kilyabin
2025-12-04 23:44:21 +04:00
parent 3f74709513
commit 56a48b4552
9 changed files with 185 additions and 14 deletions

View File

@@ -146,6 +146,7 @@ rsync -av --exclude='node_modules' \
--exclude='.env.test' \
--exclude='.env.test.local' \
--exclude='*.md' \
--exclude='db/' \
"$PROJECT_DIR/" "$INSTALL_DIR/"
# Handle .env file
@@ -162,6 +163,16 @@ else
fi
fi
# Создаем папку db для базы данных, если её нет
if [ ! -d "$INSTALL_DIR/db" ]; then
echo -e "${YELLOW}Creating db directory for database...${NC}"
mkdir -p "$INSTALL_DIR/db"
chmod 755 "$INSTALL_DIR/db"
echo -e "${GREEN}Database directory created at $INSTALL_DIR/db${NC}"
elif [ -d "$INSTALL_DIR/db" ]; then
echo -e "${GREEN}Database directory already exists, preserving existing database${NC}"
fi
# Install dependencies (with check)
echo -e "${YELLOW}Checking dependencies...${NC}"
cd "$INSTALL_DIR"