PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Celso   DB Sync   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: DB Sync
Synchronize databases between environments
Author: By
Last change:
Date: 4 months ago
Size: 3,449 bytes
 

Contents

Class file image Download

Database Sync - by Celso Nery

Maintainer Latest Version Software License Build Quality Score

Multilanguage README

en pt-br

About DB Sync

The DB Sync application was born because the development team needed to transfer data from prod to dev databases. This application drops, creates and transfers data from database-name to database-name_dev, if _dev does not exist, the application will create it.

Requirements

PHP 8.2+

  • Packages
    zip unzip libzip libzip-dev libpq-dev libpng-dev oniguruma-dev git lynx nodejs npm postgresql-client
    
  • PHP Extensions
    php82-bcmath php82-bz2 php82-calendar php82-exif php82-gettext php82-opcache php82-pcntl php82-zip php82-pgsql
    

Installation

This application is available in Github/Gitlab:

git clone [email protected]/celsonery/db-sync.git

or

git clone https://github.com/celsonery/db-sync.git

  • First you must create environment variables
    export PGHOST=<ip-of-postgresql-server>
    export PGUSER=<username-of-postgresql-user>
    export PGPASSWORD=<password-of-postgresql-user>
    
  • Run these commands in the application folder in terminal or command prompt
    composer update
    php artisan key:generate
    php artisan optimize
    php artisan serve
    

> Now you must open your browser in the url shared by above command

How to run in Docker

  • Build a docker image
    docker build -t <image-name>:<image-version> -f docker/dockerfile
    
  • Run the docker container
    docker run -itd --rm \
    --name <container-name> \
    -p <local-port>:8000 \
    -e PGHOST=<ip-of-postgresql-server> \
    -e PGUSER=<user-of-postgresql-user> \
    -e PGPASSWORD=<password-of-postgresql-user-password> \
    <image-name-created-before>
    
    > Now you must open your browser in the http://localhost:8000

To run tests

php artisan test

Generate coverage test reports

XDEBUG_MODE=coverage php artisan test --coverage-html reports/

You can see coverage tests in reports folder

/reports

All changes

Please see CHANGELOG for more details.

Contributing

Thank you for considering contributing to the db sync! The contribution guide can be found in the Contribute documentation.

Security Vulnerabilities

If you discover a security vulnerability within DB Sync, please send an e-mail to Celso Nery via [email protected]. All security vulnerabilities will be promptly addressed.

License

The DB Sync is open-sourced software licensed under the MIT license.