- pgSchema "mesh" with 4 tables isolating the peer mesh domain - Enums: visibility, transport, tier, role - audit_log is metadata-only (E2E encryption enforced at broker/client) - Cascade on mesh delete, soft-delete via archivedAt/revokedAt Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1.6 KiB
1.6 KiB
title, description, url
| title | description | url |
|---|---|---|
| Migrations | Migrate your changes to the database. | /docs/web/database/migrations |
Migrations
You have your schema in place, and you want to apply your changes to the database. TurboStarter provides you a convenient way to do so with pre-configured CLI commands.
Generating migration
To generate a migration, from the schema you need to run the following command:
pnpm with-env turbo db:generate
This will create a new .sql file in the migrations directory.
Applying migrations
To apply the migrations to the database, you need to run the following command:
pnpm with-env pnpm --filter @turbostarter/db db:migrate
This will apply all the migrations that have not been applied yet. If any conflicts arise, you can resolve them by modifying the generated migration file.
Pushing changes
To push changes directly to the database, you can use the following command:
pnpm with-env pnpm --filter @turbostarter/db db:push
This lets you push your schema changes directly to the database and omit managing SQL migration files.
Pushing changes directly to the database (without using migrations) could be risky. Please be careful when using it; we recommend it only for local development and local databases.