Sync pb
This commit is contained in:
@@ -70,7 +70,7 @@ The economy system stores all player data in [PocketBase](https://pocketbase.io/
|
||||
1. Download `pocketbase.exe` (Windows) from https://pocketbase.io/docs/ and place it in the project root.
|
||||
2. Start PocketBase: `.\pocketbase.exe serve`
|
||||
3. Open the admin UI at http://127.0.0.1:8090/_/ and create a superuser account.
|
||||
4. Create two collections for profile separation: `economy_users_dev` and `economy_users_prod` - see `docs/POCKETBASE_SETUP.md` for schema notes.
|
||||
4. Create two collections for profile separation: `economy_users_dev` and `economy_users_prod` - see `docs/POCKETBASE_SETUP.md` for schema notes, then run `python scripts/sync_pb_schema.py` to add every field the bot persists. Re-run it after any update that introduces new fields (PocketBase silently drops writes to fields missing from the schema).
|
||||
5. Set `PB_URL`, `PB_ADMIN_EMAIL`, `PB_ADMIN_PASSWORD` in `.env`.
|
||||
6. **One-time data migration** (only if you have an existing `data/economy.json`): `python scripts/migrate_to_pb.py`
|
||||
|
||||
@@ -390,7 +390,7 @@ Spend PP in `/prestigeshop`:
|
||||
- The daily set resets at **UTC midnight**, the weekly set on the **ISO week** rollover. Each player gets their own rotation.
|
||||
- Rewards are TipiCOINs (prestige coin multiplier applies) plus EXP through the normal level-up path.
|
||||
|
||||
> Schema note: the quest fields live in PocketBase - after pulling this feature run `python scripts/add_quest_fields.py` once (it patches both the dev and prod collections).
|
||||
> Schema note: the quest fields live in PocketBase - after pulling this feature run `python scripts/sync_pb_schema.py` once (it reconciles both the dev and prod collections with everything the bot persists).
|
||||
|
||||
---
|
||||
|
||||
@@ -511,8 +511,9 @@ Every slash command invocation is logged with the user ID, display name, and all
|
||||
│ └── POCKETBASE_SETUP.md # PocketBase collection schema + setup instructions
|
||||
├── scripts/
|
||||
│ ├── migrate_to_pb.py # One-time legacy migration: economy.json → PocketBase
|
||||
│ ├── add_stats_fields.py # Schema migration: add stats fields to economy_users collection
|
||||
│ ├── add_quest_fields.py # Schema migration: add quest fields (patches dev + prod)
|
||||
│ ├── sync_pb_schema.py # Reconcile PB collections with the full user schema (dev + prod)
|
||||
│ ├── add_stats_fields.py # Older partial schema migration (superseded by sync_pb_schema.py)
|
||||
│ ├── add_quest_fields.py # Older partial schema migration (superseded by sync_pb_schema.py)
|
||||
│ └── reset_pb_collections.py # Destructive: deletes & recreates economy collections (--confirm required)
|
||||
├── requirements.txt # Python dependencies
|
||||
├── .env.example # Template for secrets
|
||||
|
||||
Reference in New Issue
Block a user