All Projects → jwdeitch → pg_migrate

jwdeitch / pg_migrate

Licence: MIT license
Manage postgres schema, triggers, procedures, and views

Programming Languages

c
50402 projects - #5 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to pg migrate

lego
A lightweight SQL (string) builder using ES6 template strings. Lego embraces SQL instead of adding yet another abstraction layer.
Stars: ✭ 54 (+116%)
Mutual labels:  postgres
go-pg-crud
Simple Postgres CRUD written in Golang
Stars: ✭ 44 (+76%)
Mutual labels:  postgres
general-angular
Realtime Angular Admin/CRUD Front End App
Stars: ✭ 24 (-4%)
Mutual labels:  postgres
connect4
Connect 4️⃣Game
Stars: ✭ 1 (-96%)
Mutual labels:  postgres
realtime-flask-experiment
Experimenting with PostgreSQL's Listen/Notify and Flask-SocketIO
Stars: ✭ 22 (-12%)
Mutual labels:  postgres
nim-gatabase
Connection-Pooling Compile-Time ORM for Nim
Stars: ✭ 103 (+312%)
Mutual labels:  postgres
pgsql-ast-parser
Yet another simple Postgres SQL parser
Stars: ✭ 152 (+508%)
Mutual labels:  postgres
terraform-aws-druid
Terraform module to deploy Apache Druid in Kubernetes
Stars: ✭ 16 (-36%)
Mutual labels:  postgres
shuttletracker
🚐 Shuttle tracking for RPI.
Stars: ✭ 44 (+76%)
Mutual labels:  postgres
api.pokedextracker.com
API for pokedextracker.com
Stars: ✭ 38 (+52%)
Mutual labels:  postgres
mitoc-trips
The MIT Outing Club's trip management system
Stars: ✭ 30 (+20%)
Mutual labels:  postgres
graphql-to-sql
GraphQL model to SQL
Stars: ✭ 13 (-48%)
Mutual labels:  postgres
create-fastify-app
An utility that help you to generate or add plugin to your Fastify project
Stars: ✭ 53 (+112%)
Mutual labels:  postgres
cloud-tileserver
Serve mapbox vectortiles via AWS stack
Stars: ✭ 48 (+92%)
Mutual labels:  postgres
docker-compose-moodle
This project quickly builds a local workspace for Moodle (Apache2, PHP-FPM with XDEBUG y Postgres) using containers for each of its main components. The local workspace is built and managed by Docker Compose
Stars: ✭ 33 (+32%)
Mutual labels:  postgres
postgres-deno
A PostgreSQL extension for Deno: run Typescript in PostgreSQL functions and triggers.
Stars: ✭ 87 (+248%)
Mutual labels:  postgres
postgresql-resilient
Automatic re-connection support for PostgreSQL.
Stars: ✭ 16 (-36%)
Mutual labels:  postgres
docker-postgresql-pro-1c
Dockerfile для сборки PostgreSQL под 1С:Предприятие 8
Stars: ✭ 27 (+8%)
Mutual labels:  postgres
dlock
Interval Lock
Stars: ✭ 19 (-24%)
Mutual labels:  postgres
erdiagram
Entity-Relationship diagram code generator library
Stars: ✭ 28 (+12%)
Mutual labels:  postgres
pg_migrate
A lightweight utility to manage postgres schema, views, triggers, and functions.

-------------------
pg_migrate will recursively traverse a directory tree and run sql files postfixed with -up.sql or -down.sql. Down migrations are intended to rollback the operations defined in their up counterparts.


    Project/
	|--- views/
		|--- restaurants-up.sql
		|--- restaurants-down.sql
		|--- food/
	|--- triggers/
		|--- waitStaff-up.sql
		|--- waitStaff-down.sql
		|--- kitchenStaff-up.sql
		|--- kitchenStaff-down.sql


usage: pg_migrate -H postgres://URI [options]... dir

  -H   Host (in postgres URI format)
  -h   Show help text
  -v   Show version information
  -s   Show last 10 forward migrations ran
  -u   Migrate forward. Recursively traverses provided directory for -up.sql files
  -d   Migrate rollback. Will attempt to locate matching -down.sql files to migrate backwards
  -p   Soft run. Will display migrations to be ran / rolled back
  -g   Provisions the public schema with the pg_migrate table, used to track migrations


example usage:
> pg_migrate -H postgres://postgres:pass@localhost:5432 -p -d .
simulate an up migration for everything in this directory tree

Installation
-------------------

Download: https://github.com/jwdeitch/pg_migrate/releases/latest

** The release binaries are compiled against amd64 linux (ubuntu) and Apple OSX.

Before first migration, you must provision the database by running pg_migrate with the -g and -H flags. This is to create the "pgmigrate.manifest" table, which stores information about which migrations have been ran:
> pg_migrate -H postgres://postgres:pass@localhost:5432 -g

Notes
-------------------

- Files are transactional unless there are explicit transactions within. The migration will abort if any statement within the file fail.
- Corresponding up and down migrations must be in the same directory
- Migrations are ran in order of alphanumeric descending sort, starting with the topmost directory.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].