A Site has two kinds of thing:
- Code: pages, styles, PHP, images. This is what your agent edits. It lives in Git, and Publish moves it to Live.
- Data: bookings, sign-ups, uploaded files. Visitors create this while the Site runs. It's never published.
Preview has its own data
Each Workspace gets its own copy of the data to test with. You can add fake bookings or delete everything. None of it reaches Live, and none of Live's real data is at risk.
Changing the shape of the data
Sometimes a change needs a new table or column. That's done with a migration: a small, numbered SQL file committed with the code. Migrations run on Preview's copy as soon as they're added, and on Live when you run hm migrate.
Why migrate and Publish are separate
During hm migrate, Live is still running the old code. So migrations should only add things the old code can ignore, like a new column. The next Publish starts using it. This way Live never sees new code with an old database, or the other way round.
Before migrating, Haume saves a Restore Point. If the migration turns out wrong, hm restore puts Live back.