{"_id":"@appnificent/appnimigration","name":"@appnificent/appnimigration","dist-tags":{"latest":"0.0.8"},"versions":{"0.0.8":{"name":"@appnificent/appnimigration","version":"0.0.8","description":"Package for handling database migrations","main":"./lib/cjs/index.js","types":"./lib/cjs/types/index.d.ts","bin":{"appnimigration":"bin/migration.js"},"scripts":{"build":"npm run build:cjs && npm run build:esm","build:esm":"tsc -p ./tsconfig.esm.json && node rename.js","build:cjs":"tsc -p ./tsconfig.cjs.json","prepack":"npm run build"},"author":"","license":"ISC","dependencies":{"chalk":"^4.1.2","commander":"^10.0.0","slugify":"^1.6.5"},"devDependencies":{"@types/node":"^18.11.9","glob":"^9.2.1","ts-node":"^10.9.1","typescript":"^4.8.4"},"exports":{".":{"import":{"types":"./lib/cjs/types/index.d.ts","default":"./lib/cjs/index.js"},"require":{"types":"./lib/cjs/types/index.d.ts","default":"./lib/cjs/index.js"}}},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"gitHead":"9f941bc604fc4e1167579bb847f17d076ef08452","_id":"@appnificent/appnimigration@0.0.8","_nodeVersion":"20.0.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-EGOibFGJf8WzS3V/6kWt1VdxJeaBkfN9m7htO2uNcobF3KUXePh23ow3aOC4x7VaVAy+tMN2AphYV5LTIOve1A==","shasum":"d3cf912baa7655be7bb8d16aececa6e272232b24","tarball":"https://registry.npmjs.org/@appnificent/appnimigration/-/appnimigration-0.0.8.tgz","fileCount":49,"unpackedSize":76073,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID1asH8qrrKRdtannY4GowqAm7UGOV/Jyc7kRsae1xwXAiAfgBIJhKy+Ihv8MWkEUw9NzKK2I1IoLYBXY7gVYczzMQ=="}]},"_npmUser":{"name":"janmalcanek","email":"jan.malcanek@appnificent.dev"},"directories":{},"maintainers":[{"name":"janmalcanek","email":"jan.malcanek@appnificent.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/appnimigration_0.0.8_1710701425847_0.6601338066325153"},"_hasShrinkwrap":false}},"time":{"created":"2024-03-17T18:50:25.760Z","0.0.8":"2024-03-17T18:50:26.062Z","modified":"2024-03-17T18:50:26.667Z"},"maintainers":[{"name":"janmalcanek","email":"jan.malcanek@appnificent.dev"}],"description":"Package for handling database migrations","license":"ISC","readme":"# Available commands\r\n```npm run appnimigration init```\r\n\r\n## init\r\nInitializes migrations for the project. Creates migration folder and initial migration that creates necessary table in the database.\r\n\r\n## create [name]\r\nCreates new migration. After the creation the file is saved in the ```migrations``` folder. Helpers like ```alterTable()`` are available for the migration command.\r\n\r\n## migrate [direction]\r\nRuns the migration, direction means up or down. Down is always one step.\r\n\r\n# Configuration\r\nConfig object should be stored in the root of the project and called ```appnimigration.config.js```. Configuration object should export query method that is used to run queries against the database.\r\n\r\n```\r\nmodule.exports = {\r\n  query: async (query, bind) => {\r\n    const res = await db.query(query, bind);\r\n    return res.recordset;\r\n  },\r\n}\r\n```","readmeFilename":"README.md"}