Skip to content

Read it before you run it

Each of these is the migration file an agent produced for the request beside it. All of them are correct SQL. All of them pass a test database with forty rows in it. Say what each one locks, for how long, whether it rewrites, and what the old code does — and then run it.

The request

Add a `seen_at` column to orders recording when the row was last looked at. Default it to now.

routine

What it produced

-- Add seen_at to orders, defaulting to the current time.
ALTER TABLE orders
  ADD COLUMN seen_at timestamptz NOT NULL DEFAULT clock_timestamp();

Predict

Does this rewrite the table?

Predict

What does it lock, and for how long?

Answer the questions above, and then it runs. Guessing after the fact is not reading a migration.

Everything you do here stays in this browser.Part of liter8.sh