Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.
/ db-move Public archive

This is an (currently) experimental package for running mysql database migrations between multiple stages. Currently it only supports replacing one string (host), but it will support multiple some time.

Notifications You must be signed in to change notification settings

probots-io/db-move

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dbMove

Still under development as i find time for it. if you wanna join in, you are welcome!

This is an (currently) experimental package for running mysql database migrations between multiple stages. Currently it only supports replacing one string (host), but it will support multiple some time. More Information, Docs & Tests will follow. Here is an example config for you to play around:

{
  "paths": {
    "mysql": "mysql",
    "mysqldump": "mysqldump",
    "backups": "./backups"
  },
  "stages": {
    "development": {
      "host": "DB_HOST",
      "port": DB_PORT,
      "database": "DB_NAME",
      "username": "DB_USER",
      "password": "DB_PASSWORD",
      "exclude_tables": [], // Array of tables you want to exclude from the dumps
      "backup": true, // Create and store a backup before this Server gets overwritten?
      "replace": {
        "host": "localhost:8083" // Currently the only option to replace
      },
      "webhooks": {
        "before": "", // Execute Webhooks before Deploying (on the Source Server)
        "after": "" // Execute Webhooks before Deploying (on the Target Server)
      }
    },
    "other_stage": {
      "host": "DB_HOST",
      "port": DB_PORT,
      "database": "DB_NAME",
      "username": "DB_USER",
      "password": "DB_PASSWORD",
      "exclude_tables": [], // Array of tables you want to exclude from the dumps
      "backup": true, // Create and store a backup before this Server gets overwritten?
      "replace": {
        "host": "localhost:8083" // Currently the only option to replace
      },
      "webhooks": {
        "before": "", // Execute Webhooks before Deploying (on the Source Server)
        "after": "" // Execute Webhooks before Deploying (on the Target Server)
      }
    },
    "any_stage": {
      "host": "DB_HOST",
      "port": DB_PORT,
      "database": "DB_NAME",
      "username": "DB_USER",
      "password": "DB_PASSWORD",
      "exclude_tables": [], // Array of tables you want to exclude from the dumps
      "backup": true, // Create and store a backup before this Server gets overwritten?
      "replace": {
        "host": "localhost:8083" // Currently the only option to replace
      },
      "webhooks": {
        "before": "", // Execute Webhooks before Deploying (on the Source Server)
        "after": "" // Execute Webhooks before Deploying (on the Target Server)
      }
    },

  }
}

Store it as .dbrc in the root of your project.

To run deployments execute dbmove --source=development --target=other_stage

About

This is an (currently) experimental package for running mysql database migrations between multiple stages. Currently it only supports replacing one string (host), but it will support multiple some time.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published