Database Sync - by Celso Nery

Multilanguage README

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 git@github.com/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 celso.nery@gmail.com. All security vulnerabilities will be promptly addressed.
License
The DB Sync is open-sourced software licensed under the MIT license.