Updating
Update the three parts separately. Your events stay in D1 throughout.
The Worker
git pull
cd packages/worker
npm install
npx wrangler deployThe Database Schema
Newer versions add tables (for example event_aliases and app_settings). After pulling, apply the schema again from packages/worker:
npx wrangler d1 execute oddlytics-db --remote --file=../../schema.sqlThe schema only creates what's missing (CREATE TABLE IF NOT EXISTS) and recreates two views, so it's safe to run on a database that already has events. If the dashboard shows an error like Table "event_aliases" missing. Run migrations., this is the step you skipped.
The Dashboard
Rebuild and redeploy:
cd packages/dashboard
npm install
npm run build
npx wrangler pages deploy out --project-name=oddlytics-dashboardIf Cloudflare Pages or Vercel builds from your GitHub repository, pushing to the branch it watches is enough.
The Swift Package
In Xcode, choose File > Packages > Update to Latest Package Versions, or right-click the package and choose Update Package. With from: "1.0.0", Swift Package Manager picks up any newer 1.x release.
Backups
D1 keeps point-in-time restore history (Time Travel) for your database: 7 days on Cloudflare's free plan and 30 days on Workers Paid. To keep a copy of your own, export it from packages/worker:
npx wrangler d1 export oddlytics-db --remote --output=oddlytics-backup.sql