{"repo":"MattiLehtinen/postgrator-cli","free":true,"listed":false,"github":"https://github.com/MattiLehtinen/postgrator-cli","clone":"git clone https://github.com/MattiLehtinen/postgrator-cli.git","description":"PostgreSQL, MySQL and MS SQL database schema migration tool using plain SQL and JS files","language":"JavaScript","stars":43,"topics":["migrations","sql","postgresql","mysql","migration-tool","postgres","migrator","migrate","schema-migrations","sql-migrations"],"license":"MIT","category":"databases-storage","readme_excerpt":"Postgrator CLI [![Build Status][build-badge]][build] [![npm package][npm-badge]][npm] [![Coverage Status][coveralls-badge]][coveralls] Command line SQL database migration tool using SQL scripts. For PostgreSQL, MySQL and SQL Server. Version control your SQL database using plain old SQL files. Supports also undoing migrations. Uses Postgrator node.js library developed by Rick Bergfalk. Installation As of postgrator-cli 10 Node.js version 22.16, or 24.0 or greater is required (sqlite3 support is provided by the built-in node:sqlite module) Or if you prefer to use it locally on your project using npm scripts of package.json: And install the appropriate DB engine(s) if not installed yet: See the Postgrator documentation for more information about the supported engines. Usage SQL Files Create a folder and stick some SQL scripts in there that change your database in some way. It might look like: The files must follow the convention [version].[action].[optional-description].sql or [version].[action].[optional-description].js Version must be a number, but you may start and increment the numbers in any way you'd like. If you choose to use a purely sequential numbering scheme instead of something based off a timestamp, you will find it helpful to start with 000s or some large number for file organization purposes. Action must be either \"do\" or \"undo\". Do implements the version, and undo undoes it. Optional-description can be a label or tag to help keep track of what happens inside the ","default_branch":null,"files":null,"tree":[],"storefront":"/r/MattiLehtinen","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/MattiLehtinen/postgrator-cli/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}