Registry / database / dbup-downtown

dbup-downtown

JSON →
library0.0.13jsnpmunverified

Lightweight database migration command-line tool for Sqlite3. Version 0.0.13 is the latest release. It uses JSON-based migration files with 'up' and 'down' SQL statements, and supports directional migration, fake migrations, listing, and creation of blank migrations. No custom DSL: migrations are raw SQL. Only Sqlite3 supported currently, but extensible to other databases. Provides a single 'migrations' table for state tracking. Suitable for simple projects needing file-based migrations without overhead.

npm install dbup-downtown
INSTALL
IMPORT
SIG · DBUP-DOWNTOWN
D
dbup-downtown
databasejavascriptv0.0.13
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const dbup = require('dbup-downtown')
Package is a CLI tool; programmatic usage not documented.

Runs a migration up by one step using environment variables for folder and database path.

MIGRATIONS_FOLDER=migrations PATH_TO_DB=mydb.sqlite npx dbup-downtown migrate up
Debug
Known issues
gotchaOnly Sqlite3 database files are supported currently.
fix
Use a Sqlite3 database file or contribute a provider for MySQL/PostgreSQL.
affects: >=0.0.0
gotchaMigration file names must follow YYYYMMDDHHMM.json pattern; non-conforming files are ignored.
fix
Use the `new` command to create properly named files, or manually name them correctly.
affects: >=0.0.0
gotchaThe `up` and `down` keys must contain valid SQL for the target database; no syntax validation is performed.
fix
Ensure SQL statements are correct for your database (e.g., Sqlite3).
affects: >=0.0.0
gotchaCommands like `migrate 1 down` will cause an error because 'down' cannot be parsed as an integer.
fix
Use `migrate down 1` or `migrate -1` to migrate down by one.
affects: >=0.0.0
Errors
Common errors & fixes
Error: No MIGRATIONS_FOLDER environment variable set
Required environment variable MIGRATIONS_FOLDER is not set.
fix
Set MIGRATIONS_FOLDER to the path of your migrations folder, e.g., export MIGRATIONS_FOLDER=migrations
Error: No PATH_TO_DB environment variable set
Required environment variable PATH_TO_DB is not set.
fix
Set PATH_TO_DB to the path of your Sqlite3 database file, e.g., export PATH_TO_DB=my.db
Error: Migration file '...' does not follow naming convention.
Migration file name does not match the pattern YYYYMMDDHHMM.json.
fix
Rename the file to follow the pattern, e.g., 202501010000.json
Upgrade
Version history
0.0.13latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
3 hits · last 30 days
node
2
Amazon
1
Resources
dbup-downtown — npm install dbup-downtown · libregistry