SudoBot uses Drizzle ORM for database schema management. Migration files live in theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/onesoft-sudo/sudobot/llms.txt
Use this file to discover all available pages before exploring further.
drizzle/ directory and are applied using BlazeBuild’s migrate task or a manual script when BlazeBuild is not available (e.g. on Windows).
Running migrations with BlazeBuild
This is the recommended approach on Linux and macOS:DB_URL, applies any pending migrations from the drizzle/ directory, and creates or updates the required tables.
Running migrations manually
If BlazeBuild is unavailable or you are on Windows, you can run migrations with a small script.- Bun
- Node.js
Create Run it:
migrate.ts in the project root:migrate.ts
Docker automatic migrations
When running via Docker Compose, SudoBot checks the.migration_status file on startup. If it is empty, migrations run automatically before the bot starts. You do not need to run migrations manually for Docker deployments on first start.
Verifying migration status
Connect to your PostgreSQL database and check the__drizzle_migrations table to see which migrations have been applied:
Prerequisites
Make sureDB_URL is set in your .env file before running migrations:
.env
