g4/db-tools

Database migration related tools

1.1.0 2023-11-08 08:56 UTC

This package is auto-updated.

Last update: 2024-12-08 11:36:22 UTC


README

Usage

Inside project folder, it's required to create this set of folders

db/
  dumps/ 
  logs/
  migrations/
    default/

Root folder may be configured with parameter ruckusing_dir.

Command line has some required options:

 ini - Relative path to application.ini which contain's database configuration files
 env - Environment which will be read from application.ini
 sql-dump - Relative path to SQL file that needs to be imported
 ruckusing_dir - dir name of where database and migration related files are

Example:

php vendor/g4/db-tools/bin/tools.php import:data env=$(env) sql-dump=${ND_API_SQL_DUMP} ini=${APPLICATION_INI} ruckusing_dir=${RUCKUSING_DIR}
php vendor/g4/db-tools/bin/ruckus.php db:status env=$(env) ini=${APPLICATION_INI} ruckusing_dir=${RUCKUSING_DIR}

This variables should be defined inside Makefile like:

APPLICATION_INI  = application/setup/config/application.ini
RUCKUSING_DIR    = db
ND_API_SQL_DUMP  = $(RUCKUSING_DIR)/dumps/nd_api_v1.0.0.sql
GEONAME_SQL_DUMP = $(RUCKUSING_DIR)/dumps/geoname.compact.sql

Import db-tools makefile targets into project's Makefile with

include vendor/g4/db-tools/dbtools.mk