Update the database
Apply the database changes a new ruumica version brings, and see which are applied.
Each ruumica version carries the database changes it needs, built into the program. Applying them is one command, safe to repeat.
Before you start
DATABASE_URLnames the database.- For a production database, a backup. A procedure for backup and restore is not designed yet (Feature status).
Steps
-
Apply the changes that are not applied yet:
$ asbuilt db migrate …It prints each change it applies, then the count. On an up-to-date database it applies nothing.
-
See what is applied:
$ asbuilt db status 0001 init applied …
Check
Every line of asbuilt db status ends in applied.
What can go wrong
| You see | Meaning | Do |
|---|---|---|
--database-url <DATABASE_URL> is required |
DATABASE_URL is not set. |
Set it, or give --database-url. |
| A change fails | The database differs from what the change expects. | Stop and report the message. Each change is applied completely or not at all, so the failed one left nothing behind; changes before it in the same run stay applied. |
Applied changes are never edited. A correction always comes as a new change, so every database moves forward the same way.