Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
macro_db_migrator
What it is
Exposes MacroDB's embedded SQLx migrator without pulling in the database client.
Migration files belong in ../macro_db_client/migrations/.
Start here
src/lib.rs: the sharedMACRO_DB_MIGRATIONSstatic.src/test.rs: historical-schema upgrade and migration failure regression tests.src/test/*.sql: fixtures targeting the schema before and after an upgrade.
Scope
- Owns: embedding migrations and testing migration sequencing and atomicity.
- Not here: application queries or schema files; use the owning crate or MacroDB client.
Checks
- Run
cargo test -p macro_db_migratorwithSQLX_OFFLINEunset and a local database. - Run
just checkfor code changes.
Gotchas
- Start historical-schema tests with an empty public schema; CI's test template may already contain all migrations.
- Use SQL fixtures for statements that target a historical schema; current-schema SQLx macros cannot validate columns that have since been removed or added.
- Exercise concurrent indexes through SQLx's migrator, outside explicit transactions.
- Keep the migrations fingerprint
build.rspasses as a cfg: sccache keys this crate on its arguments, and without it CI reused a migrator missing a renamed migration.