{"id":48907,"library":"pg-upmig","title":"pg-upmig","description":"A forward-only PostgreSQL migration tool (v0.0.30) that discourages rollbacks and forces developers to think of migrations as whole units. It supports both SQL and programmatic JavaScript migrations, and integrates with a custom PostgreSQL client or the default node-postgres driver. Configurable via environment variables or .upmigrc.js. Less popular than node-pg-migrate or db-migrate, but offers a unique philosophy of no rollbacks.","status":"active","version":"0.0.30","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/Come2Daddy/pg-upmig","tags":["javascript","database","postgres","postgresql","migration","migrate","migrator","pg","sql"],"install":[{"cmd":"npm install pg-upmig","lang":"bash","label":"npm"},{"cmd":"yarn add pg-upmig","lang":"bash","label":"yarn"},{"cmd":"pnpm add pg-upmig","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package is CommonJS-only; no ESM support.","wrong":"import upmig from 'pg-upmig';","symbol":"upmig","correct":"const upmig = require('pg-upmig');"},{"note":"Constructor must be called with 'new'","wrong":"const migration = upmig.create({...});","symbol":"migration instance","correct":"const migration = new upmig({...});"},{"note":"steps must be passed as an object property, not as a number.","wrong":"migration.up(2).then(...);","symbol":"migration.up()","correct":"migration.up({ steps: 2 }).then(...);"}],"quickstart":{"code":"const upmig = require('pg-upmig');\n\nconst migration = new upmig({\n  options: {\n    migrations: './migrations',\n    table: 'pg_upmig',\n    debug: false\n  },\n  connection: {\n    host: 'localhost',\n    port: 5432,\n    database: 'mydb',\n    user: 'postgres',\n    password: process.env.PGPASSWORD ?? ''\n  }\n});\n\nmigration.up({ steps: 1 })\n  .then(() => console.log('Migration applied'))\n  .catch(err => console.error(err));","lang":"javascript","description":"Shows how to instantiate the migrator with a connection and apply one pending migration."},"warnings":[{"fix":"Design migrations to be idempotent or handle rollbacks manually via additional SQL scripts.","message":"Migrations are forward-only — no rollback mechanism. If a migration alters data, you cannot revert automatically.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Use `module.exports = (client, method) => { return new Promise(...); }`","message":"JS migration files must export a CommonJS function returning a Promise. If you export an ESM default or a non-function, it will fail silently or throw.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Ensure your client wrapper implements these methods with the expected signatures.","message":"If you use a custom client, it must expose `query`, `connect`, and `end` methods (or those configured via options).","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"search_vec":"'client':39 'configur':47 'custom':37 'databas':73 'db':62 'db-migrat':61 'default':42 'develop':17 'discourag':13 'driver':46 'environ':49 'forc':16 'forward':6 'forward-on':5 'integr':34 'javascript':31,72 'less':53 'migrat':9,21,32,59,63,76,77,78 'node':44,57 'node-pg-migr':56 'node-postgr':43 'offer':65 'pg':2,58,79 'pg-upmig':1 'philosophi':68 'popular':54 'postgr':45,74 'postgresql':8,38,75 'programmat':30 'rollback':14,71 'sql':28,80 'support':26 'think':19 'tool':10 'uniqu':67 'unit':24 'upmig':3 'upmigrc.js':52 'v0.0.30':11 'variabl':50 'via':48 'whole':23","created_at":"2026-06-07T16:59:04.684854+00:00","updated_at":"2026-06-07T16:59:04.684854+00:00","problems":[{"fix":"Use `const migration = new upmig(...);`","cause":"Forgot to instantiate with `new` or imported incorrectly.","error":"TypeError: migration.up is not a function"},{"fix":"Check host, port, and that the database is accessible.","cause":"PostgreSQL server not running or wrong connection parameters.","error":"Error: connect ECONNREFUSED"},{"fix":"Ensure the database user has CREATE TABLE privilege.","cause":"First run: the tool creates the table automatically but may fail if connection lacks permissions.","error":"Migration table pg_upmig does not exist"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/Come2Daddy/pg-upmig#readme","github":"ssh://git@github.com/Come2Daddy/pg-upmig","docs":null,"changelog":null,"pypi":null,"npm":"pg-upmig","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}