salsita / node-pg-migrate
Node.js database migration management for PostgreSQL
AI Architecture Analysis
This repository is indexed by RepoMind. By analyzing salsita/node-pg-migrate in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.
Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.
Repository Overview (README excerpt)
Crawler viewnode-pg-migrate Node.js database migration management built exclusively for postgres. (But can also be used for other DBs conforming to SQL standard - e.g. CockroachDB.) Started by Theo Ephraim, then handed over to Salsita Software and now maintained by @Shinigami92. Preconditions ⢠Node.js 20.11 or higher ⢠PostgreSQL 13 or higher (lower versions may work but are not supported officially) If you don't already have the library installed, you will need to add pg as either a direct or dev dependency Installation Installing this module adds a runnable file into your directory. If installed globally (with the -g option), you can run and if not, you can run Quick Example Add to section of your so you are able to quickly run commands. Run . It will create file in folder. Open it and change contents to: Save migration file. Now you should put your DB connection string to environment variable and run . (e.g. ) You should now have two tables in your DB :tada: If you want to change your schema later, you can e.g. add lead paragraph to posts: Run , edit : Run and there will be a new column in table :tada: Want to know more? Read docs: Docs Full docs are available at https://salsita.github.io/node-pg-migrate Explanation & Goals _Why only Postgres?_ - By writing this migration tool specifically for postgres instead of accommodating many databases, we can actually provide a full featured tool that is much simpler to use and maintain. I was tired of using crippled database tools just in case one day we switch our database. _Async / Sync_ - Everything is async in node, and that's great, but a migration tool should really just be a fancy wrapper that generates SQL. Most other migration tools force you to bring in control flow libraries or wrap everything in callbacks as soon as you want to do more than a single operation in a migration. Plus by building up a stack of operations, we can automatically infer down migrations (sometimes) to save even more time. _Naming / Raw Sql_ - Many tools force you to use their constants to do things like specify data types. Again, this tool should be a fancy wrapper that generates SQL, so whenever possible, it should just pass through user values directly to the SQL. The hard part is remembering the syntax of the specific operation, not remembering how to type "timestamp"! Contributing š **Welcome, new contributors!** Whether you're a seasoned developer or just getting started, your contributions are valuable to us. Don't hesitate to jump in, explore the project, and make an impact. License MIT