{"id":18652,"library":"parse-dbtool","title":"parse-dbtool","description":"A CLI tool for Parse Server that creates database migration and seeder files using Parse.Schema. Current stable version 1.2.0 (no frequent releases). It operates as a standalone executable via npx, requiring environment variables (APPLICATION_ID, SERVER_URL, MASTER_KEY) to connect to a Parse Server instance. Unlike ORM-based migration tools, it works natively with Parse Server's schema system and supports strict mode (allowClientClassCreation: false, addField: false). Key differentiator: it generates migrations and seeds specifically for Parse Platform, not general SQL/NoSQL databases.","status":"active","version":"1.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/fakhrullah/parse-dbtool","tags":["javascript","parse-server","migration","seeder"],"install":[{"cmd":"npm install parse-dbtool","lang":"bash","label":"npm"},{"cmd":"yarn add parse-dbtool","lang":"bash","label":"yarn"},{"cmd":"pnpm add parse-dbtool","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Migration files export a function that receives the Parse instance. Use CommonJS module.exports, not ES modules.","symbol":"default export (migration template)","correct":"module.exports = (Parse) => { ... }"},{"note":"Parse.Schema is a constructor; you must instantiate it per class. Methods like addField, deleteField return promises or use callbacks.","wrong":"Parse.Schema.addField('name', 'String');","symbol":"Parse.Schema","correct":"let schema = new Parse.Schema('ClassName'); schema.addField('name', 'String'); schema.save();"},{"note":"Seeders create Parse.Object instances. Always use the class name in constructor. Requires async/await or .then().","wrong":"let obj = new Parse.Object(); obj.save();","symbol":"Parse.Object (for seeders)","correct":"let obj = new Parse.Object('ClassName'); obj.set('field', 'value'); await obj.save();"}],"quickstart":{"code":"// 1. Initialize folder structure\nnpx parse-dbtool init\n\n// 2. Set up .env file with Parse Server credentials\n// Create a .env file with:\nAPPLICATION_ID=myAppId\nSERVER_URL=http://localhost:1337/parse\nMASTER_KEY=myMasterKey\n\n// 3. Create a migration\nnpx parse-dbtool migration:make create_pet\n\n// 4. Edit generated file databases/migrations/XXXXXXXXXXXXXX-create_pet.js:\n'use strict';\nmodule.exports = {\n  up: async (Parse) => {\n    const schema = new Parse.Schema('Pet');\n    schema.addField('name', 'String');\n    schema.addField('species', 'String');\n    await schema.save();\n  },\n  down: async (Parse) => {\n    const schema = new Parse.Schema('Pet');\n    await schema.delete();\n  }\n};\n\n// 5. Run migration\nnpx parse-dbtool migrate\n\n// 6. (Optional) Create a seeder\nnpx parse-dbtool seed:make seed_pets\n\n// Edit databases/seeders/XXXXXXXXXXXXXX-seed_pets.js:\n'use strict';\nmodule.exports = {\n  up: async (Parse) => {\n    const pet1 = new Parse.Object('Pet');\n    pet1.set('name', 'Fluffy');\n    pet1.set('species', 'Cat');\n    await pet1.save();\n    const pet2 = new Parse.Object('Pet');\n    pet2.set('name', 'Buddy');\n    pet2.set('species', 'Dog');\n    await pet2.save();\n  },\n  down: async (Parse) => {\n    const query = new Parse.Query('Pet');\n    const pets = await query.find({ useMasterKey: true });\n    await Parse.Object.destroyAll(pets, { useMasterKey: true });\n  }\n};\n\n// 7. Run seeder\nnpx parse-dbtool db:seed","lang":"javascript","description":"Shows full workflow: init, create migration, create seeder, and run both using parse-dbtool CLI."},"warnings":[{"fix":"Use module.exports = { up, down }; instead of export default.","message":"All migration files must use CommonJS exports (module.exports), not ES module import/export.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Test 'down' thoroughly and manually verify schema state.","message":"The 'down' migration may not fully revert complex schema changes (e.g., adding fields vs deleting fields).","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure .env exists or pass env vars inline: APPLICATION_ID=... npx parse-dbtool migrate","message":"Environment variables must be set before running commands; .env file is only read if present and ENV_FILE not specified.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use environment variables or secrets manager; never hardcode master key in code or .env files committed to source control.","message":"parse-dbtool uses Parse master key for all operations; ensure MASTER_KEY is kept secure and not committed.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Ensure up/down functions accept Parse parameter and use it instead of a global Parse.","cause":"The migration/seed function expects Parse as argument, but code references Parse without using the parameter.","error":"Error: Parse is not defined"},{"fix":"Run 'npx parse-dbtool init' first to create the folder structure, then ensure you are in the project root.","cause":"Migration file not found; usually due to wrong working directory or missing 'init' step.","error":"Cannot find module 'databases/migrations/...'"},{"fix":"Always provide a non-empty class name to new Parse.Schema('ClassName').","cause":"Trying to create or modify a schema without specifying a valid class name.","error":"Error: Invalid schema: class name must not be empty"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}