{"id":47274,"library":"clunky-migration-tool","title":"Clunky Migration Tool","description":"A version migration tool written in Bash for applying upgrades from a source to a target, commonly used for PostgreSQL database schema and data migrations. Current stable version is 1.0.0. It follows a release cadence of manual releases via GitHub. Key differentiators: it is source- and target-agnostic via a simple Bash function interface, supports both incremental and from-scratch migrations, and includes a built-in filetree source and psql target. It is minimal and fast compared to heavier alternatives like Flyway or Liquibase.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/ogheorghies/clunky-migration-tool","tags":["javascript","migration","schema","database","version"],"install":[{"cmd":"npm install clunky-migration-tool","lang":"bash","label":"npm"},{"cmd":"yarn add clunky-migration-tool","lang":"bash","label":"yarn"},{"cmd":"pnpm add clunky-migration-tool","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required when using psql target for PostgreSQL migrations","package":"psql","optional":true}],"imports":[{"note":"It is a Bash script, typically installed via git clone or curl and added to PATH. No npm import.","wrong":"npx clunky-migration-tool","symbol":"clunky-migration-tool","correct":"clunky-migration-tool -m filetree:psql"},{"note":"The URI is set via environment variable, not command-line argument.","wrong":"clunky-migration-tool -m filetree:psql -d postgres://user:pwd@localhost:5432/app","symbol":"env var CMT_TARGET_PSQL_URI","correct":"CMT_TARGET_PSQL_URI=postgres://user:pwd@localhost:5432/app clunky-migration-tool -m filetree:psql"},{"note":"Debug version is set via environment variable for dry-run display.","wrong":"clunky-migration-tool -m filetree:debug -v CMT_TARGET_DEBUG_VERSION=v3 v5","symbol":"env var CMT_TARGET_DEBUG_VERSION","correct":"CMT_TARGET_DEBUG_VERSION=v3 clunky-migration-tool -m filetree:debug v5"}],"quickstart":{"code":"#!/bin/bash\n# Install clunky-migration-tool from GitHub\ngit clone https://github.com/ogheorghies/clunky-migration-tool.git /tmp/clunky-migration-tool\nexport PATH=$PATH:/tmp/clunky-migration-tool/bin\n\n# Set up target database URI\nCMT_TARGET_PSQL_URI=postgres://user:pwd@localhost:5432/app\n\n# Run migration to latest version\nclunky-migration-tool -m filetree:psql\n\n# For a dry-run to version v5\nCMT_TARGET_DEBUG_VERSION=v3 clunky-migration-tool -m filetree:debug v5","lang":"bash","description":"Installs the tool, sets up a PostgreSQL target, and runs a migration to the latest version, followed by a dry-run to a specific version."},"warnings":[{"fix":"Ensure /bin/bash is version 4 or later. On macOS, use 'brew install bash' and set shebang accordingly.","message":"The tool is a Bash script and requires Bash 4+ for associative arrays and process substitution.","severity":"gotcha","affected_versions":">=0.0"},{"fix":"Wrap all migration SQL in a single transaction; the tool expects target_accept_changes to be transactional.","message":"The psql target runs actual SQL against the database; no rollback is performed on failure beyond transaction scope. Ensure source_get_changes returns transactional changes.","severity":"gotcha","affected_versions":">=0.0"},{"fix":"Use version names like 'v1', 'v2', etc., avoiding reserved words.","message":"Version names must not contain special strings 'first', 'last', 'scratch' as they are reserved by the tool.","severity":"gotcha","affected_versions":">=0.0"},{"fix":"Never modify source/target implementations during a migration run.","message":"The tool sources and targets are Bash functions; if you rename or delete a source/target script mid-migration, it will fail.","severity":"breaking","affected_versions":">=0.0"}],"env_vars":null,"search_vec":"'1.0.0':33 'agnost':52 'altern':86 'appli':12 'bash':10,56 'built':71 'built-in':70 'cadenc':38 'clunki':1 'common':20 'compar':83 'current':29 'data':27 'databas':24,94 'differenti':45 'fast':82 'filetre':73 'flyway':88 'follow':35 'from-scratch':63 'function':57 'github':43 'heavier':85 'includ':68 'increment':61 'interfac':58 'javascript':91 'key':44 'like':87 'liquibas':90 'manual':40 'migrat':2,6,28,66,92 'minim':80 'postgresql':23 'psql':76 'releas':37,41 'schema':25,93 'scratch':65 'simpl':55 'sourc':16,48,74 'stabl':30 'support':59 'target':19,51,77 'target-agnost':50 'tool':3,7 'upgrad':13 'use':21 'version':5,31,95 'via':42,53 'written':8","created_at":"2026-06-07T16:50:41.012371+00:00","updated_at":"2026-06-07T16:50:41.012371+00:00","problems":[{"fix":"Ensure the source file is in the expected directory and sourced properly: source ./mysource.sh","cause":"The source script is not sourced correctly or not executable.","error":"source_get_version: Command not found"},{"fix":"Install postgresql client (e.g., apt-get install postgresql-client) or adjust PATH.","cause":"PostgreSQL client (psql) is not installed or not in PATH when using psql target.","error":"psql: command not found"},{"fix":"Check the target script for unbalanced quotes or backticks, and ensure proper Bash syntax.","cause":"A Bash syntax error in a target function due to missing backticks or quotes.","error":"target_get_current_version: unexpected EOF while looking for matching ``"}],"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/ogheorghies/clunky-migration-tool#readme","github":"https://github.com/ogheorghies/clunky-migration-tool","docs":null,"changelog":null,"pypi":null,"npm":"clunky-migration-tool","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","devops"],"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}}