{"_id":"trona-evolutions","_rev":"200-bfd3658bc93870cb050de463c6a158a6","name":"trona-evolutions","dist-tags":{"latest":"0.0.5"},"versions":{"0.0.1":{"name":"trona-evolutions","version":"0.0.1","keywords":["sql","database","migrations"],"author":{"name":"Stanislav Golikov"},"license":"MIT","_id":"trona-evolutions@0.0.1","maintainers":[{"name":"stanislavsky","email":"stanislavsky34@gmail.com"}],"homepage":"https://github.com/solid-soda/trona-evolutions#readme","bugs":{"url":"https://github.com/solid-soda/trona-evolutions/issues"},"bin":{"trona-evolutions-run":"./bin/run.js","trona-evolutions-iniit":"./bin/init.js"},"dist":{"shasum":"ef4d059146e247938563726dafffaa5b549c5235","tarball":"https://registry.npmjs.org/trona-evolutions/-/trona-evolutions-0.0.1.tgz","fileCount":9,"integrity":"sha512-/u4KFneJ+ioMdINwHIj18j0tRGHJn+FJ9rx1uy8iD8LZuIhWxdeRVJlkj6/7s3ezxJcTCfi5XFLChWgFIPEnPQ==","signatures":[{"sig":"MEUCIA8ETsHb6dEn1pbv47JZL14JVNyfAyfPz4/Nz9EMQqMvAiEAjDJqEuXd+2dvcGOzXB2aoK+VkCE1mQ/NpWUCmvt3oBk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13411,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbPpSiCRA9TVsSAnZWagAA0t4P/jcN6+821+mfqYCnowEH\nfrHCrgPIkCbo5C9pXA7gS1qkkNjKmjEWMCMw/BRoBJURzyXZ0IEAFfIvO31G\nl2ZykFjhy0QoFqlnEVOrBuSoZEbY9k7+oRhNGe4BEYcvkfRz5IfAniDCknZ7\n/AYZH7SEv5DMrCr3TUbzJFMFA8neshym01qd5TF+9eNhc5F2aqzqBFdoOCx3\nXPjExJCEneoz/DutL6ZZuW+NPj6L5gNVcHw9St0SEm/kufBMNG+I0diSXjMP\n+nm5Uh7j5jw46nDhyLnPGFAv4gA+92pdGXoPfsSW6bAUkNPliDge1/t47QJh\nkRL8FWce/p3scx6F7PdNDVH2HUpbkrPPLwILjLTVpAtrMR/Kay4Gm9vmQu8g\nm4lY831bxPiKYVQdR3uXRWDgDrtXlIk0CGZGq2fFmbYzdwXQqdDqXIe6lfQ2\n8LSJcS1IMhGyehhQwUcwV6ZPlzT4xdXi2gl/YZaX5hVVWUrlV7In7qGd+qVd\nIhqTLhuzjPoZl4lVLVDyG3P3OwI0nluOXH38hwFxRzAEHKjJSBLfHD8koZOH\nSrPPG0CoCxn5BQgnDkDhwCNysOmxOxPjCGxgjt5oSK220xowABDxrvQYe/DS\nIrucHwIqJBB717/EL8ybVOn7XtCfjLLDqKElmKMGEBGb0N0DDxFECDuDsk2C\nH5M7\r\n=tOub\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"368e39415828639d32548d2f516c7bbbbab0533d","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"stanislavsky","email":"stanislavsky34@gmail.com"},"repository":{"url":"git+https://github.com/solid-soda/trona-evolutions.git","type":"git"},"_npmVersion":"6.1.0","description":"Simple library providing scala-play like evolutions","directories":{},"_nodeVersion":"10.5.0","dependencies":{"fs":"0.0.1-security","md5":"^2.2.1","path":"^0.12.7","mysql":"^2.15.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/trona-evolutions_0.0.1_1530827937905_0.37491702413288075","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"trona-evolutions","version":"0.0.2","keywords":["sql","database","migrations"],"author":{"name":"Stanislav Golikov"},"license":"MIT","_id":"trona-evolutions@0.0.2","maintainers":[{"name":"stanislavsky","email":"stanislavsky34@gmail.com"}],"homepage":"https://github.com/solid-soda/trona-evolutions#readme","bugs":{"url":"https://github.com/solid-soda/trona-evolutions/issues"},"bin":{"trona-evolutions-run":"./bin/run.js","trona-evolutions-init":"./bin/init.js"},"dist":{"shasum":"59aaf1561055ec5a06e6b3229f92f1fd2bed797f","tarball":"https://registry.npmjs.org/trona-evolutions/-/trona-evolutions-0.0.2.tgz","fileCount":9,"integrity":"sha512-/ylUaLYp8FGcj+GlFfN6pfqQdcW6OaNGiLn+iHbe3UiF5XNN6AGjK3YFClRs3Uht+Bw90P3nnN6n9Lm/OJ+O7w==","signatures":[{"sig":"MEUCIQDHF2QRZgHbAcXW0ZQYyIyaefVHFQl4tNP6rPamV0gBEAIgBinBkXde5i6UwHi9wPypbcFz2q4XdpgsYPYk8En98DQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbPpuUCRA9TVsSAnZWagAApHAP/R7dPJv9vEz9EeTPb3Iz\nYUxrhdlXLstfrfA3+SNCI/AIAkU6j2bwrEMGTz5GGEWVLKjt5T+C8r3SkBwW\nSV4279WODjNHE2Z9t2/QsSgq5BFI7LV/uh7CHvxJ6pNXDRjaOF7yTorbVIG/\nh+a1BbezOmVbrr/tpX7EwJvxEZGvfc0JJZyN8a5TxHVJOJ+MkBSyUQY43J4K\n0NpsDGbb0gEWkG0LYTk0qmnmcThYkdc3QpqeIjC1glAqaIQRiJ+p1OStpgpb\n6u3cTpbgjntz+6SUUd13QMRVwUnlKoaqlC1G8hnKjVaZdY1Lo6CcMDeKj4+d\nWw7r8q+8KzypVTvXPgygSjzS0sKA5gGvwMY5REITOg0dFLI39de0ZMHzYbvu\nRTc8kXuGL3BhLzAaf1E5V8l0GYFhvn6YwYIPzZZeyp4OEb6SC51s4JEyQJ9k\nwx6TfY+HOaZD63V8e1NDh+iRHqhvjBqWli2NJ+8CeQdCeVaJBHSl7EdDAPNV\nq1RzAc0MS/P2EerZPOV2DIpaNuB/bcQcWICSMII8tsAhDLyL5JeO69lDCUX6\nUmQwwk3rx3E2FBQA9ejqQEJ5VPzRS0HdCKoaVnjE4Ia/kIATyIO6odi2mTH6\n2mcHof7iDBgtqa+FxD0yvhPSIRH2ErABAOGWXFPXuvnefj4CKwabRaRCPwbL\n4dQT\r\n=QV1x\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"1c593e07375671238753d32d256270b6c7b4d60a","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"stanislavsky","email":"stanislavsky34@gmail.com"},"repository":{"url":"git+https://github.com/solid-soda/trona-evolutions.git","type":"git"},"_npmVersion":"6.1.0","description":"Simple library providing scala-play like evolutions","directories":{},"_nodeVersion":"10.5.0","dependencies":{"fs":"0.0.1-security","md5":"^2.2.1","path":"^0.12.7","mysql":"^2.15.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/trona-evolutions_0.0.2_1530829716244_0.3210810112248599","host":"s3://npm-registry-packages"}},"0.0.4":{"name":"trona-evolutions","version":"0.0.4","keywords":["sql","database","migrations"],"author":{"name":"Stanislav Golikov"},"license":"MIT","_id":"trona-evolutions@0.0.4","maintainers":[{"name":"stanislavsky","email":"stanislavsky34@gmail.com"}],"homepage":"https://github.com/solid-soda/trona-evolutions#readme","bugs":{"url":"https://github.com/solid-soda/trona-evolutions/issues"},"bin":{"trona-evolutions":"./bin/index.js"},"dist":{"shasum":"6b8663cdc8a82cc132a1511a6c2aa7bc85cece27","tarball":"https://registry.npmjs.org/trona-evolutions/-/trona-evolutions-0.0.4.tgz","fileCount":11,"integrity":"sha512-wyZVXDZ+5jOV3TmlRoog7rqs7oWBx8rWJnEYaQsjxcbY1BrsB6JbzsoAYaCLT1ZV0O8E9+LPjMU1fRObAO2e8A==","signatures":[{"sig":"MEUCIFc94IhXGlyd/wV2w8lG2TelAfaC1PcEdgu+qPx0LMC6AiEAvs0A4xhVt6lHI1nuEuWusxBP5D8fRZ3KjytLdxG67QY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13412,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbk7DLCRA9TVsSAnZWagAAHtYP/j4TmiZbzeqoDFPPp0ez\ntQyxLZORKxugRanWAz+sGV9W82BXHLxbY6XI6uM9V2mMpWyC5hvkk7cxxRmJ\nBGUHf2DjEre7qaXV7iDiAkoqI4XLRMbg3ruwTyuz4OB4IEa2mT2Y06+4Jl7Z\nCNifZN+Qn13ybSJPuKzRYGLyNBIjLLbiLydUsmcRiLPb9N0caO0XsGb/sMNi\n4u/pUiOcybglWQvWaZZw9bck5mfRQtO6uRxQRyytMbE12kZOKHCNT239J+k/\nZoc6fwQIX1gMj65NX36lsz1NyfnkPj62Bto3eN80D1CRdvUqfOzR+HszEooq\nhjPOY7KHIqJ/0uNpxUD+rEqw5wHOOQvND0CE/Zg7kOZSvwZ4nEioSbun+nIa\nyqQSWo7Nsf2udqhG2TMX7wS6hk4PJw+bN1TwNA3AYfYJnyporIiR8yFaAlEM\niIQxPpLfJCS11YRsH/d7ivRG7KOWJeDrHUX6Tl+eHgKBkt/jgs3rlaRearJ3\nSMSgshAFmLwpGRh+nsPpq9tiU0ppjGhQBmgJqCHt4kjvfHhf0fA6dEQb0L85\nY6esW3mNXCT0U+AxpocIiM6nLZOMJKhMXdrSCz3blcEqAcikBJbOITgA8FqV\n4Jf1UZS5Y2A7ySTgdhU5+XzoIU3C91qaAUz4JWhdrjZAKFylmaRMFlMa7ZR9\njioG\r\n=7ncJ\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"d1ac9556768973b2225668ce759dc72f830cf44d","scripts":{"lint":"eslint . --fix","test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"stanislavsky","email":"stanislavsky34@gmail.com"},"repository":{"url":"git+https://github.com/solid-soda/trona-evolutions.git","type":"git"},"_npmVersion":"6.1.0","description":"Simple library providing scala-play like evolutions","directories":{},"_nodeVersion":"10.5.0","dependencies":{"fs":"0.0.1-security","md5":"^2.2.1","path":"^0.12.7"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^5.2.0","@solid-soda/eslint-config":"^2.1.4"},"_npmOperationalInternal":{"tmp":"tmp/trona-evolutions_0.0.4_1536405706417_0.80876637267596","host":"s3://npm-registry-packages"}},"0.0.5":{"name":"trona-evolutions","version":"0.0.5","keywords":["sql","database","migrations"],"author":{"name":"Stanislav Golikov"},"license":"MIT","_id":"trona-evolutions@0.0.5","maintainers":[{"name":"stanislavsky","email":"stanislavsky34@gmail.com"}],"homepage":"https://github.com/solid-soda/trona-evolutions#readme","bugs":{"url":"https://github.com/solid-soda/trona-evolutions/issues"},"bin":{"trona-evolutions":"./bin/index.js"},"dist":{"shasum":"107a0ebfa59eef880dbd3bb26d48ac3248f048ea","tarball":"https://registry.npmjs.org/trona-evolutions/-/trona-evolutions-0.0.5.tgz","fileCount":11,"integrity":"sha512-+viZDs2xZs3IL/urJGI/8VgJQwKujWYXF/+8Bd2mbHHEupKMIDaK02RpmkZakBRFU4q+7c5px/jt3PDjk+9jnQ==","signatures":[{"sig":"MEUCICZ6hZFejF9bkof4IDLGSShzwNXLWsEwsdtppJ9w2MdKAiEAldfovrIzccs1Mbn8/v9/Z+/FfjlaGjpGkRVW2XoGxII=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13444,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbk7bKCRA9TVsSAnZWagAAaGgP/12fAFtvENGIK3GqL66R\nhEueEh/FAuNRhLNwJkZ+GYO/D0aDUoLTOOqKFYn2gVVA5xXTzd4lNsnC+dNM\nOyoIkqyWp0Xz1A0wKq0B2oFS/TMPz+PBSdY7AKU5bA0ie50lKYIrCEtNlyrC\niBfmUz4HwPGNoRlzdLqEs0gpzwISgBfVC2AcgUV+R2C1REWHofLsNSYXPEMl\nR6Qzww8BSc0u27sVOrcCeUAMGVL9IXKPSgLGnxD6JnIgUgca4YckUAE839HC\noojnEVmd3TeiYk43h4DpoBZlTz888X+2BfYuyI+iD9N992Btn+GV9vPxaJC9\nSICKLN3Tto2rRCEm7UMfyBZGkfvoF/RJaoMkdtY5tMNQirzlbu+m/AqKvIZf\nFRYVptlSVW1VzcNtxmQFcUYspXsIb1xTxD9yAQipBkTE86fUbLX5r5SiFhuX\ngGZesSlJq3tXbqnJ9SHNGLS1WusxWJCH1MZSNelQP/CQaYguYGsfd+oZh3bS\n+oTi04/lfvhIiktDtWSiUeGT53h7modCnVVEyNqCrkcJbPZruqjs3RK+2Mh+\nHAS9/n+XKFjYCJyLxfWqhYC/rajv2/NdQkd2T6DDDpN8q2T6dBT4nc9pYbH6\nkXuS8x8lyzvVtmeOWb53zfyMkfLokZ9AJoh9zdBd/0s0HF6k1zaBInKr1eNs\nw7Y0\r\n=XKgA\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"552edbf83fea6727f9232acec33b6579db2fd443","scripts":{"lint":"eslint . --fix","test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"stanislavsky","email":"stanislavsky34@gmail.com"},"repository":{"url":"git+https://github.com/solid-soda/trona-evolutions.git","type":"git"},"_npmVersion":"6.1.0","description":"Simple library providing scala-play like evolutions","directories":{},"_nodeVersion":"10.5.0","dependencies":{"fs":"0.0.1-security","md5":"^2.2.1","path":"^0.12.7","command-line-args":"^5.0.2"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^5.2.0","@solid-soda/eslint-config":"^2.1.4"},"_npmOperationalInternal":{"tmp":"tmp/trona-evolutions_0.0.5_1536407241429_0.8508706343063461","host":"s3://npm-registry-packages"}}},"time":{"created":"2018-07-05T21:58:57.904Z","modified":"2026-09-24T14:40:54.145Z","0.0.1":"2018-07-05T21:58:58.013Z","0.0.2":"2018-07-05T22:28:36.327Z","0.0.4":"2018-09-08T11:21:46.565Z","0.0.5":"2018-09-08T11:47:21.536Z"},"bugs":{"url":"https://github.com/solid-soda/trona-evolutions/issues"},"author":{"name":"Stanislav Golikov"},"license":"MIT","homepage":"https://github.com/solid-soda/trona-evolutions#readme","keywords":["sql","database","migrations"],"repository":{"url":"git+https://github.com/solid-soda/trona-evolutions.git","type":"git"},"description":"Simple library providing scala-play like evolutions","maintainers":[{"email":"npm@npmjs.com","name":"npm"},{"email":"ops@npmjs.com","name":"npmci"},{"email":"saquibkhan@github.com","name":"saquibkhan"},{"email":"tayvon@github.com","name":"tayvongh"},{"email":"karenjli@github.com","name":"karenjli"},{"email":"nishantms@github.com","name":"nishantms"},{"email":"shmam@github.com","name":"shmam"},{"email":"reggi@github.com","name":"reggi"},{"email":"dhei@github.com","name":"dhei"},{"email":"maitxn@github.com","name":"maitxn"},{"email":"jver@microsoft.com","name":"joelverhagen-gh"},{"email":"martin.ruiz.mares@gmail.com","name":"martinrrm"},{"email":"kartyksantiago@gmail.com","name":"kartyk-github"},{"email":"bhaveshbhati@github.com","name":"bhaveshbhati"},{"email":"deekshitha2812@github.com","name":"deekshitha2812"},{"email":"vinayakmsft@github.com","name":"vinayakmsft"},{"email":"bpoluri@microsoft.com","name":"poluri"},{"email":"snehapar9@github.com","name":"snehapar9"},{"email":"mcumming@microsoft.com","name":"mcumming"},{"email":"nikolce1kolev@gmail.com","name":"nkolev92"}],"readme":"# trona-evolitions\r\n\r\nOften your migration scenarios are as good as ORM you using. Sometimes it leads to inability (without\r\nsome extra efforts) to use all features of your chosen DB. This library allows you to write \r\nmigration scenarios using sql and run them with a single console command.\r\n\r\n## Usage example\r\n\r\n```console\r\nfoo@bar:~$ trona-evolutions --init\r\nInitializing evolutions table evolutions\r\n\r\nCREATE TABLE evolutions (\r\n    id INTEGER NOT NULL,\r\n    checksum VARCHAR(32) NOT NULL,\r\n    down_script TEXT NOT NULL,\r\n    primary key (id)\r\n);\r\n\r\nEvolutions table successfully created!\r\nfoo@bar:~$ trona-evolutions\r\nRunning evolve script\r\n\r\n--- 1.sql ---\r\n\r\nCREATE TABLE Customers (\r\n    id INTEGER NOT NULL,\r\n    name VARCHAR(32) NOT NULL,\r\n    description TEXT NOT NULL,\r\n    primary key (id)\r\n);\r\n\r\nEvolution is successful!\r\n\r\nfoo@bar:~$\r\n```\r\n\r\n## Installation and configuration\r\n\r\nFirst you need to install trona-evolutions globally via npm\r\n\r\n```console\r\nfoo@bar:~$ npm install -g trona-evolutions\r\n```\r\n\r\nThan you need to setup simple configuration file named .trona-config.js and containing script that\r\nexports object containing fields:\r\n1) runQuery - MANDATORY callback that accepts SQL as it's first argument and returns Promise object \r\nwhich is rejected in case of failure of said query and in case of SELECT query successfully \r\nexecuted contains array of selected rows in form of an object {[field]: value}.\r\n2) tableName - OPTIONALLY name of tha table that would contain information about evolutions, it would\r\nbe created automatically by init script. Default - \"evolutions\".\r\n3) evolutionsFolderPath - OPTIONALLY relative path to folder that contains .sql files of migration\r\nscripts if form of a sring or string[]. Default - \"evolutions\".\r\n\r\nExample of a config for mysql database:\r\n\r\n```javascript\r\nconst mysql = require('mysql');\r\n\r\nconst con = mysql.createConnection({\r\n    host: \"localhost\",\r\n    user: \"root\",\r\n    password: \"123\",\r\n    database: 'playground',\r\n});\r\n\r\ncon.connect(function(err) {\r\n    if (err) throw err;\r\n    console.log(\"Connected!\");\r\n});\r\n\r\nmodule.exports = {\r\n    evolutionsFolderPath: ['db', 'evolutions'],\r\n    tableName: 'my_evolutions',\r\n    runQuery (query) {\r\n        return new Promise((resolve, reject) => {\r\n            con.query(query, (err, result) => {\r\n                if (err) {\r\n                    reject(err);\r\n                } else {\r\n                    resolve(result);\r\n                }\r\n            });\r\n        })\r\n    }\r\n}\r\n```\r\n\r\nAfter module have been installed run command and .trona-config.js created run\r\n\r\n```console\r\nfoo@bar:~$ trona-evolutions --init\r\n```\r\n\r\nThis command will create table with information about evolutions.\r\nThan create a folder with for your evolutions script and add your first evolution to it. Note the\r\nrules which you should follow writing said evolutions:\r\n\r\n1) Name file {evolution-number}.sql (e.g. 1.sql)\r\n2) Write up and fallback scripts in file and separate them via \"#DOWN\" comment as at the\r\nexample below\r\n\r\nFolder content example:\r\n```\r\n- evolutions\r\n    - 1.sql\r\n    - 2.sql\r\n    - 3.sql\r\n    ...\r\n```\r\n\r\nEvolution contents example:\r\n\r\n```sql\r\nCREATE TABLE Customers (\r\n    id INTEGER NOT NULL,\r\n    name VARCHAR(32) NOT NULL,\r\n    description TEXT NOT NULL,\r\n    primary key (id)\r\n);\r\n\r\n#DOWN\r\n\r\nDROP TABLE Customers;\r\n```\r\n\r\nRun command \r\n```console\r\nfoo@bar:~$ trona-evolutions\r\n```\r\n\r\n## Usage\r\nAfter you managed to successfully setup trona-evolutions you can run trona-evolutions-run command.\r\nThis command will automatically detect any changed or new files in your evolutions folder, run\r\nrespected fallback scripts if needed and than evolve your databae schema (e. g. if you have 1.sql,\r\n2.sql, and 3.sql evolutions already in your database, you have changed 2.sql and added 4.sql it will \r\nrun fallback for 3.sql and 2.sql and than run 2.sql, 3.sql, and 4.sql scripts)\r\n","readmeFilename":"README.md"}