muster-migrate

command
v0.175.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command muster-migrate applies muster's migrations to the database named by DATABASE_URL and exits.

🔴 IT IS A CI AND DEVELOPMENT FIXTURE, NOT A DEPLOY STEP. The server migrates itself at boot.

It also carries the ROLLBACK for migration 0007 (row-level security), and it ships in the image as /muster-migrate for exactly that:

/muster-migrate --rls-off   disable RLS + owner_id DEFAULT 1, so an image
                            built before accounts PR 3a can run against
                            this schema (internal/db/rollback/rls_off.sql)
/muster-migrate --rls-on    re-apply 0007 (undo --rls-off)

Either flag does ONLY that — no migrations are applied in the same run — and then reads the state back and prints it per owned table, failing if any is wrong. 🔴 Run them from THIS binary (or newer), BEFORE reverting the image: an older /muster-migrate ignores the flag, says "nothing to apply" and exits 0. This exists so the TEMPLATE database that internal/dbtest copies can be migrated ONCE, before the test binaries start — otherwise the first Postgres-backed package to run pays the whole bootstrap under an advisory lock while every other package queues behind it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL