ludwig-br/postgres-migration

Lightweight php migration tool for PostgreSQL databases

v1.0.1 2017-10-26 23:26 UTC

This package is not auto-updated.

Last update: 2024-05-26 02:39:31 UTC


README

Lightweight php migration tool for PostgreSQL databases.

Getting Started

Prerequisites

To use this tool you need to have installed:

Php 7.1+
PostgreSQL 9.6+

Details: composer.json

Installing

composer require ludwig-br/postgres-migration

After downloading (with composer or manually) you need to do configuration. Every part you may need to touch is marked with a "ToDo"-statement.

  • copy the content of the example/ directory into your project
.../my_project/database/migrations/

After finishing the configuration you should get a security copy of you database.

https://www.postgresql.org/docs/current/static/backup.html

Finally you can generate your first migration files!

cd .../my_project/database/migration
php generate.php

The files will be placed in the directories specified in config/Directories.php for restoration or updating the database after small changes use

cd .../my_project/database/migration
php reload.php

Additional Information

This project is meant to offer an easy and lightweight way to integrate your (PostgreSQL) Database into your version control system. Furthermore minor changes to the database schema during developement can be applied easily. During generation your database will be altered, therefore please get a security copy before you use this tool. I advice using this tool only in a development environment.

License

This project is licensed under the MIT License - see the LICENSE.md file for details