{"agent":"codex","input":"Migrate this Fastify API from MySQL to PostgreSQL and open a pull request. Read package.json, src/plugins/external/knex.ts, src/plugins/external/env.ts, @types/node/environment.d.ts, .env.example, docker-compose.yml, .github/workflows/ci.yml, every file in scripts/ and migrations/, src/plugins/app/tasks/tasks-repository.ts, src/plugins/app/users/users-repository.ts, test/helper.ts and test/routes/api/tasks/tasks.test.ts first. Replace mysql2 with pg and add pg-query-stream because tasks-repository.ts streams through Knex. Set the Knex client to pg. Rename the MYSQL_* variables to DATABASE_HOST, DATABASE_PORT, DATABASE_USER, DATABASE_PASSWORD and DATABASE_NAME everywhere they appear. Rewrite migrations/*.sql for Postgres: identity columns instead of AUTO_INCREMENT, no backticks, and a set_updated_at() trigger function with BEFORE UPDATE triggers on users and tasks in place of ON UPDATE CURRENT_TIMESTAMP, with drops in the undo files. Switch Postgrator to the pg driver. Make every insert that reads the new id use .returning('id') in the repositories and the test helpers. Rewrite scripts/create-database.ts, drop-database.ts and seed-database.ts for pg: check pg_database before creating, truncate with RESTART IDENTITY CASCADE from pg_tables, use RETURNING id, and never truncate schemaversion. Change docker-compose.yml and the CI service to a postgres image with a pg_isready health check. Start Postgres, run npm run db:create, npm run db:migrate, npm run test, npm run lint and npm run build -- --noEmit, and paste the output in the pull request. Update the Database section of README.md. Do not change any route, schema or plugin that does not touch the database.","resources":[{"url":"https://github.com/your-org/your-app"}]}