Documentation
¶
Overview ¶
Package migrations creates and upgrades the CMS's database schema from SQL files embedded in the module, so host applications need no external migration tool.
Each supported engine has its own directory of migration files under sql/, sharing one version sequence: sql/postgres/0007_x.sql and sql/mysql/0007_x.sql are the same change expressed twice. The DDL dialects differ too much to translate mechanically — identity columns, timestamp types, and the fact that MySQL cannot index a TEXT column all need a human decision — so they are maintained side by side.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
Run applies any migrations that have not yet been applied, in version order. It is safe to call on every startup.
On Postgres each file runs in its own transaction, so a failure rolls back. MySQL and MariaDB commit DDL implicitly, so a failure there can leave a partially applied migration needing manual repair; the version is only recorded on success, so a re-run retries the whole file.
Types ¶
This section is empty.