Quickgrate copies table stuctures and table contents from a master database to a slave database. I use it in order to have production data in my dev environments for real world testing purposes. Be careful, it deletes existing tables on slave!
Install the package
npm install @tibormarias/quickgrate --save-dev
Create a file named quickgrate.config.js in your project's root directory with the following structure
export default {
master: {
host: "127.0.0.1",
port: "3306",
user: "user",
password: "pass",
database: "production",
},
slave: {
host: "127.0.0.1",
port: "3306",
user: "user",
password: "pass",
database: "development"
},
rows_limit: 25000,
tables: {
do_not_create: [],
do_not_seed: []
}
}
npx quickgrate
--changes
only remove and seed tables that are different on slave then on master
Want to contribute? I am grateful for any contribution, feel free to code it or message me!