add product image and variant value

This commit is contained in:
2026-02-15 10:22:07 +03:30
parent 2b3abfc599
commit 98cf3d0a92
8 changed files with 129 additions and 91946 deletions
+17
View File
@@ -39,3 +39,20 @@
- Review all names before running the populate script
The final CSV will have all original columns plus the new "icon_name" column with your custom names.
---
## Import named icons into the database
To insert icons from `named_icons.csv` into the `icons` table:
1. **Ensure your database is running** and `.env` in the project root has `DB_HOST`, `DB_PORT`, `DB_NAME`, `DB_USER`, and `DB_PASS` (same as for `dump-icons.sh` / `restore-icons.sh`).
2. **Optional:** Set which icon group to attach icons to:
- `ICON_GROUP_ID` (default: `01KD7DG4VCTWZRSA54M3PEJ6NW` — پک آیکون 1). Use an existing `icon_groups.id` from your DB.
3. **From the project root**, run:
```bash
node dump/import-named-icons.js
```
The script reads `dump/named_icons.csv` (columns: Index, Name, URL) and inserts one row per URL into `icons` with generated ULID and timestamps. The **Name** column is not stored (the `icons` table has no name column); only **URL** and **group_id** are used.