skip to content
early access · antil is not publicly available yet and commands may change · join the waitlist

the antil field manual how-to

change a schema privately

view markdown

Use a private database for the worker changing the shop schema. The starter already uses private databases. This procedure starts from the seed; it does not copy current orders.

End only the worker that needs the new schema:

Terminal window
antil session end

Replace seed.sql in that worktree with a catalog that includes a SKU:

CREATE TABLE products (id integer PRIMARY KEY, name text NOT NULL, price_cents integer NOT NULL, sku text NOT NULL);
INSERT INTO products (id, name, price_cents, sku) VALUES
(1, 'Field notebook', 1200, 'NOTE-01'),
(2, 'Canvas tool roll', 3500, 'ROLL-01');
CREATE TABLE orders (id serial PRIMARY KEY, product_id integer REFERENCES products(id));

Keep the other worktree’s files untouched. Keep sharing: private on resources.db (the default).

Start the worker again:

Terminal window
antil session start --json

Read its new database name and wait for the API’s /health check. Run the shop tests in this worktree, then in the other worktree:

Terminal window
antil run test --json

Both should report status: ok, a succeeded command, and exit code 0. Follow each result’s log action; both test reports should show two passes. Open both storefronts and place an order in each. In the unchanged worktree, antil status --json should still show its original database name and ready apps. The old database from the changed worktree remains retained until you prune it.

For an existing shared database, take this fresh private route before changing its schema. Live database copying and recipes are coming; antil does not automatically move an already running worker when you edit SQL. Commands you launch outside antil are not prevented from changing a shared database.