Upgrading
club follows semantic versioning. The database schema is applied idempotently on every startup, so upgrading is typically as simple as pulling a new image and restarting — there are no manual migration commands.
Before You Upgrade
-
Read the release notes for the version you are upgrading to. Check for breaking changes or special migration instructions.
-
Back up your data. See Backup & Restore for instructions. At minimum, back up the metadata store (database).
-
Test in a staging environment if possible, especially for major version upgrades.
Upgrade Steps
-
Back up your data:
Terminal window # SQLitesqlite3 /data/club.db ".backup /backups/club-pre-upgrade.db"# Filesystem blobstar -czf /backups/packages-pre-upgrade.tar.gz -C /data packages/ -
Pull the new image:
Terminal window docker pull club:latest# Or pin to a specific version:docker pull club:1.2.0 -
Stop the current container:
Terminal window docker compose down -
Start with the new image:
Terminal window docker compose up -d -
Verify the upgrade:
Terminal window # Check healthcurl https://packages.example.com/api/v1/health# Check version in responsecurl -s https://packages.example.com/api/v1/health | jq .version# Tail logs for any errors during schema applicationdocker compose logs club --tail 50
If using a specific version tag in your docker-compose.yml, update it:
services: club: image: club:1.2.0 # Update version here-
Back up your data (same as Docker).
-
Pull the latest code:
Terminal window cd /opt/clubgit pull origin main# Or checkout a specific tag:git checkout v1.2.0 -
Update dependencies and regenerate models:
Terminal window dart pub getcd packages/club_coredart run build_runner build --delete-conflicting-outputscd ../.. -
Rebuild the frontend:
Terminal window cd packages/club_webnpm installnpm run buildcd ../.. -
Build and restart:
Terminal window # Build with dart build cli (NOT dart compile exe)dart build cli -t packages/club_server/bin/server.dart -o build/server# The binary is at build/server/bundle/bin/serversudo cp build/server/bundle/bin/server /usr/local/bin/club# Restartsystemctl restart club -
Verify the upgrade:
Terminal window curl https://packages.example.com/api/v1/healthjournalctl -u club --since "5 minutes ago"
Schema Behavior
Idempotent, Not Versioned
club does not use a versioned migration table. Instead, the entire schema is expressed as a list of idempotent statements that run on every server startup:
CREATE TABLE IF NOT EXISTS ...CREATE INDEX IF NOT EXISTS ...ALTER TABLE ... ADD COLUMN ...(with duplicate-column errors caught)CREATE VIRTUAL TABLE IF NOT EXISTS ... USING fts5(...)
There is no schema_migrations table. There are no numbered script files. Every boot re-applies the full schema; the IF NOT EXISTS clauses and column-exists guards make this safe.
What This Means for Upgrades
| Scenario | Behavior |
|---|---|
| New tables added in the new version | Created on first boot of the new binary |
| New columns added to existing tables | Added via ALTER TABLE on first boot |
| New indexes | Created on first boot |
| Column renames or drops | Require explicit, release-specific data migration code — see release notes |
| Unchanged schema | No-op; schema statements re-run but nothing changes |
You do not run a “migrate” command before or after upgrading. The server applies the schema during boot, before it starts accepting requests.
Rollback Procedure
If an upgrade causes issues, you can roll back to the previous version.
-
Stop the server:
Terminal window docker compose down# or: systemctl stop club -
Restore the database from backup:
Terminal window # SQLitecp /backups/club-pre-upgrade.db /data/club.db# PostgreSQLpg_restore -h db.example.com -U club -d club /backups/club-pre-upgrade.dump -
Restore blob storage if needed:
Terminal window tar -xzf /backups/packages-pre-upgrade.tar.gz -C /data -
Switch back to the previous version:
Terminal window # Docker# Edit docker-compose.yml to use the previous image tagdocker compose up -d# From sourcegit checkout v1.1.0dart build cli -t packages/club_server/bin/server.dart -o build/serversudo cp build/server/bundle/bin/server /usr/local/bin/clubsystemctl start club -
Verify the rollback:
Terminal window curl https://packages.example.com/api/v1/health
Any packages published or tokens created after the upgrade are lost with the database restore. This is why backing up before upgrading is critical.
Version Pinning
For production deployments, always pin to a specific version rather than using latest:
services: club: image: club:1.2.0 # Pin to specific versionThis prevents accidental upgrades and ensures reproducible deployments. Update the version tag deliberately after testing.