{"id":24287932,"url":"https://github.com/marianozunino/morpheus","last_synced_at":"2025-07-18T02:41:46.179Z","repository":{"id":43408936,"uuid":"461000436","full_name":"marianozunino/morpheus","owner":"marianozunino","description":"Morpheus is a modern, open-source database migration tool for Neo4j. It is designed to be a simple, intuitive tool for managing database migrations. The project is inspired by Michael Simons' tool for Java.","archived":false,"fork":false,"pushed_at":"2025-07-15T15:16:39.000Z","size":1402,"stargazers_count":24,"open_issues_count":2,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-16T05:24:05.685Z","etag":null,"topics":["cli","database","database-migrations","migration","migrations","neo4j","nestjs","nodejs","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marianozunino.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-02-18T20:45:50.000Z","updated_at":"2025-07-15T15:16:44.000Z","dependencies_parsed_at":"2024-10-26T02:32:22.310Z","dependency_job_id":"4ccbf736-0b41-4eb7-9cc6-77298b74f09b","html_url":"https://github.com/marianozunino/morpheus","commit_stats":{"total_commits":54,"total_committers":4,"mean_commits":13.5,"dds":0.4629629629629629,"last_synced_commit":"5839ffceacf4b273aaf12e4a3062519f3372caad"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/marianozunino/morpheus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marianozunino%2Fmorpheus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marianozunino%2Fmorpheus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marianozunino%2Fmorpheus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marianozunino%2Fmorpheus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marianozunino","download_url":"https://codeload.github.com/marianozunino/morpheus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marianozunino%2Fmorpheus/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265692788,"owners_count":23812207,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","database","database-migrations","migration","migrations","neo4j","nestjs","nodejs","typescript"],"created_at":"2025-01-16T09:24:28.761Z","updated_at":"2025-07-18T02:41:46.163Z","avatar_url":"https://github.com/marianozunino.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Morpheus\n\n[![build-deploy](https://github.com/marianozunino/morpheus/actions/workflows/build_deploy.yml/badge.svg)](https://github.com/marianozunino/morpheus/actions/workflows/build_deploy.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n\u003ca href='https://coveralls.io/github/marianozunino/morpheus?branch=master'\u003e\n  \u003cimg src='https://coveralls.io/repos/github/marianozunino/morpheus/badge.svg?branch=master\u0026kill_cache=1' alt='Coverage Status'\u003e\n\u003c/a\u003e\n![npm type definitions](https://img.shields.io/npm/types/morpheus4j)\n[![Downloads/week](https://img.shields.io/npm/dw/morpheus4j.svg)](https://npmjs.org/package/morpheus4j)\n[![Version](https://img.shields.io/npm/v/morpheus4j.svg)](https://npmjs.org/package/morpheus4j)\n\u003ca href=\"http://nestjs.com/\" target=\"blank\"\u003e\u003cimg src=\"https://nestjs.com/img/logo-small.svg\" width=\"25\" alt=\"Nest Logo\" /\u003e\u003c/a\u003e\n\n### About\nMorpheus is a modern, open-source database migration tool for [Neo4j](http://neo4j.com). It is designed to be a simple, intuitive tool for managing database migrations. The project is inspired by [Michael Simons' tool for Java](https://github.com/michael-simons/neo4j-migrations).\n\n### Quick Start\n```bash\nnpm install -g morpheus4j\nmorpheus init         # Create config file\nmorpheus create user-nodes  # Creates V1_0_0__user-nodes.cypher\nmorpheus migrate     # Run migrations\n```\n\n### Prerequisites\n- Node.js\n- Neo4j database (4.4.4 or 5.x)\n- npm or yarn package manager\n\n### Migration Files\nMigration files:\n- Use `.cypher` extension\n- Are versioned using semver (e.g., `V1_0_0__create_users.cypher`)\n- Contain pure Cypher queries\n- Each statement must end with a semicolon\n\nExample migration file `V1_0_0__create_users.cypher`:\n```cypher\nCREATE CONSTRAINT user_email IF NOT EXISTS FOR (u:User) REQUIRE u.email IS UNIQUE;\n\nCREATE (u:User {\n  email: 'admin@example.com',\n  name: 'Admin User',\n  created_at: datetime()\n});\n```\n\n### File Naming Convention\nMigration files follow this pattern:\n- Prefix: `V` (for version)\n- Version: Semver numbers separated by underscores (e.g., `1_0_0`)\n- Separator: Double underscore `__`\n- Description: Descriptive name using hyphens\n- Extension: `.cypher`\n\nExample: `V1_0_0__create-user-constraints.cypher`\n\n### Environment Variables\nMorpheus supports the following environment variables:\n- `MORPHEUS_HOST` - Neo4j host\n- `MORPHEUS_PORT` - Neo4j port\n- `MORPHEUS_SCHEME` - Neo4j scheme\n- `MORPHEUS_USERNAME` - Neo4j username\n- `MORPHEUS_PASSWORD` - Neo4j password\n- `MORPHEUS_DATABASE` - Neo4j database name\n- `MORPHEUS_MIGRATIONS_PATH` - Path to migrations directory\n\n### Best Practices\n- Keep migrations small and focused\n- Use descriptive names for migration files\n- Test migrations in a development environment first\n- Back up your database before running migrations in production\n- Don't modify existing migrations - create new ones to make changes\n\n### Troubleshooting\n- **Checksum Mismatch**: Occurs when trying to modify an existing migration. Create a new migration instead.\n- **Connection Issues**: Verify your Neo4j credentials and connection settings in morpheus.json\n- **Missing Semicolons**: Ensure all Cypher statements end with semicolons\n\n\u003c!-- The following sections are auto-generated by oclif --\u003e\n# Usage\n\u003c!-- usage --\u003e\n```sh-session\n$ npm install -g morpheus4j\n$ morpheus COMMAND\nrunning command...\n$ morpheus (--version)\nmorpheus4j/4.5.2 linux-x64 node-v20.19.3\n$ morpheus --help [COMMAND]\nUSAGE\n  $ morpheus COMMAND\n...\n```\n\u003c!-- usagestop --\u003e\n# Commands\n\u003c!-- commands --\u003e\n* [`morpheus autocomplete [SHELL]`](#morpheus-autocomplete-shell)\n* [`morpheus clean`](#morpheus-clean)\n* [`morpheus create NAME`](#morpheus-create-name)\n* [`morpheus delete VERSION`](#morpheus-delete-version)\n* [`morpheus info`](#morpheus-info)\n* [`morpheus init`](#morpheus-init)\n* [`morpheus migrate`](#morpheus-migrate)\n* [`morpheus validate`](#morpheus-validate)\n\n## `morpheus autocomplete [SHELL]`\n\nDisplay autocomplete installation instructions.\n\n```\nUSAGE\n  $ morpheus autocomplete [SHELL] [-r]\n\nARGUMENTS\n  SHELL  (zsh|bash|powershell) Shell type\n\nFLAGS\n  -r, --refresh-cache  Refresh cache (ignores displaying instructions)\n\nDESCRIPTION\n  Display autocomplete installation instructions.\n\nEXAMPLES\n  $ morpheus autocomplete\n\n  $ morpheus autocomplete bash\n\n  $ morpheus autocomplete zsh\n\n  $ morpheus autocomplete powershell\n\n  $ morpheus autocomplete --refresh-cache\n```\n\n_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v3.2.6/src/commands/autocomplete/index.ts)_\n\n## `morpheus clean`\n\nClean up migration-related database objects\n\n```\nUSAGE\n  $ morpheus clean [--json] [--debug] [--drop-constraints] [-c \u003cvalue\u003e] [-m \u003cvalue\u003e] [-h \u003cvalue\u003e] [-p\n    \u003cvalue\u003e] [-s \u003cvalue\u003e] [-P \u003cvalue\u003e] [-u \u003cvalue\u003e] [-d \u003cvalue\u003e]\n\nFLAGS\n  -P, --password=\u003cvalue\u003e        Neo4j password. Env: 'MORPHEUS_PASSWORD'\n  -c, --configFile=\u003cvalue\u003e      [default: /home/runner/work/morpheus/morpheus/morpheus.json] Path to the morpheus file\n                                (CWD/morpheus.json by default)\n  -d, --database=\u003cvalue\u003e        Neo4j database. Env: 'MORPHEUS_DATABASE'\n  -h, --host=\u003cvalue\u003e            Neo4j host. Env: 'MORPHEUS_HOST'\n  -m, --migrationsPath=\u003cvalue\u003e  [default: neo4j/migrations] Migrations path. Env: 'MORPHEUS_MIGRATIONS_PATH'\n  -p, --port=\u003cvalue\u003e            Neo4j port. Env: 'MORPHEUS_PORT'\n  -s, --scheme=\u003cvalue\u003e          Neo4j scheme. Env: 'MORPHEUS_SCHEME'\n  -u, --username=\u003cvalue\u003e        Neo4j username. Env: 'MORPHEUS_USERNAME'\n      --drop-constraints        Additionally remove all Morpheus-related database constraints\n\nGLOBAL FLAGS\n  --debug  Enable debug logging\n  --json   Format output as json.\n\nDESCRIPTION\n  Clean up migration-related database objects\n\n  Removes all Morpheus migration metadata including nodes, relationships, and optionally constraints.\n  Use with caution as this will reset the migration history.\n\nEXAMPLES\n  $ morpheus clean\n\n  $ morpheus clean --drop-constraints\n\n  $ morpheus clean --config ./custom-config.json\n```\n\n_See code: [src/commands/clean.ts](https://github.com/marianozunino/morpheus/blob/v4.5.2/src/commands/clean.ts)_\n\n## `morpheus create NAME`\n\nGenerate a new timestamped migration file with boilerplate code\n\n```\nUSAGE\n  $ morpheus create NAME [--json] [-c \u003cvalue\u003e] [-m \u003cvalue\u003e]\n\nARGUMENTS\n  NAME  Name of the migration (will be prefixed with a semver number)\n\nFLAGS\n  -c, --configFile=\u003cvalue\u003e      [default: /home/runner/work/morpheus/morpheus/morpheus.json] Path to the morpheus file\n                                (CWD/morpheus.json by default)\n  -m, --migrationsPath=\u003cvalue\u003e  [default: neo4j/migrations] Migrations path. Env: 'MORPHEUS_MIGRATIONS_PATH'\n\nGLOBAL FLAGS\n  --json  Format output as json.\n\nDESCRIPTION\n  Generate a new timestamped migration file with boilerplate code\n\nEXAMPLES\n  $ morpheus create add-user-nodes\n\n  $ morpheus create update-relationships -m ~/path/to/migrations\n\n  $ morpheus create update-relationships --config ./custom-config.json\n```\n\n_See code: [src/commands/create.ts](https://github.com/marianozunino/morpheus/blob/v4.5.2/src/commands/create.ts)_\n\n## `morpheus delete VERSION`\n\nDelete a migration from the database.\n\n```\nUSAGE\n  $ morpheus delete VERSION [--json] [--debug] [-c \u003cvalue\u003e] [-m \u003cvalue\u003e] [-h \u003cvalue\u003e] [-p \u003cvalue\u003e] [-s\n    \u003cvalue\u003e] [-P \u003cvalue\u003e] [-u \u003cvalue\u003e] [-d \u003cvalue\u003e] [--dry-run]\n\nARGUMENTS\n  VERSION  The version that should be deleted\n\nFLAGS\n  -P, --password=\u003cvalue\u003e        Neo4j password. Env: 'MORPHEUS_PASSWORD'\n  -c, --configFile=\u003cvalue\u003e      [default: /home/runner/work/morpheus/morpheus/morpheus.json] Path to the morpheus file\n                                (CWD/morpheus.json by default)\n  -d, --database=\u003cvalue\u003e        Neo4j database. Env: 'MORPHEUS_DATABASE'\n  -h, --host=\u003cvalue\u003e            Neo4j host. Env: 'MORPHEUS_HOST'\n  -m, --migrationsPath=\u003cvalue\u003e  [default: neo4j/migrations] Migrations path. Env: 'MORPHEUS_MIGRATIONS_PATH'\n  -p, --port=\u003cvalue\u003e            Neo4j port. Env: 'MORPHEUS_PORT'\n  -s, --scheme=\u003cvalue\u003e          Neo4j scheme. Env: 'MORPHEUS_SCHEME'\n  -u, --username=\u003cvalue\u003e        Neo4j username. Env: 'MORPHEUS_USERNAME'\n      --dry-run                 Perform a dry run - no changes will be made to the database\n\nGLOBAL FLAGS\n  --debug  Enable debug logging\n  --json   Format output as json.\n\nDESCRIPTION\n  Delete a migration from the database.\n\n  This command can be used to repair broken migration chains. If you accidentally deleted a migration file, you can use\n  this command to find the previous migration and delete it.\n\nEXAMPLES\n  $ morpheus delete 1.0.0\n\n  $ morpheus delete 1.2.3 --config ./custom-config.json\n\n  $ morpheus delete 1.4.0 --dry-run\n```\n\n_See code: [src/commands/delete.ts](https://github.com/marianozunino/morpheus/blob/v4.5.2/src/commands/delete.ts)_\n\n## `morpheus info`\n\nInfo up migration-related database objects\n\n```\nUSAGE\n  $ morpheus info [--json] [--debug] [-c \u003cvalue\u003e] [-m \u003cvalue\u003e] [-h \u003cvalue\u003e] [-p \u003cvalue\u003e] [-s \u003cvalue\u003e] [-P\n    \u003cvalue\u003e] [-u \u003cvalue\u003e] [-d \u003cvalue\u003e]\n\nFLAGS\n  -P, --password=\u003cvalue\u003e        Neo4j password. Env: 'MORPHEUS_PASSWORD'\n  -c, --configFile=\u003cvalue\u003e      [default: /home/runner/work/morpheus/morpheus/morpheus.json] Path to the morpheus file\n                                (CWD/morpheus.json by default)\n  -d, --database=\u003cvalue\u003e        Neo4j database. Env: 'MORPHEUS_DATABASE'\n  -h, --host=\u003cvalue\u003e            Neo4j host. Env: 'MORPHEUS_HOST'\n  -m, --migrationsPath=\u003cvalue\u003e  [default: neo4j/migrations] Migrations path. Env: 'MORPHEUS_MIGRATIONS_PATH'\n  -p, --port=\u003cvalue\u003e            Neo4j port. Env: 'MORPHEUS_PORT'\n  -s, --scheme=\u003cvalue\u003e          Neo4j scheme. Env: 'MORPHEUS_SCHEME'\n  -u, --username=\u003cvalue\u003e        Neo4j username. Env: 'MORPHEUS_USERNAME'\n\nGLOBAL FLAGS\n  --debug  Enable debug logging\n  --json   Format output as json.\n\nDESCRIPTION\n  Info up migration-related database objects\n\n  Removes all Morpheus migration metadata including nodes, relationships, and optionally constraints.\n  Use with caution as this will reset the migration history.\n\nEXAMPLES\n  $ morpheus info\n\n  $ morpheus info --config ./custom-config.json\n```\n\n_See code: [src/commands/info.ts](https://github.com/marianozunino/morpheus/blob/v4.5.2/src/commands/info.ts)_\n\n## `morpheus init`\n\nInitialize a new Morpheus configuration file with database connection settings\n\n```\nUSAGE\n  $ morpheus init [-c \u003cvalue\u003e] [-f]\n\nFLAGS\n  -c, --configFile=\u003cvalue\u003e  [default: /home/runner/work/morpheus/morpheus/morpheus.json] Path to the morpheus file\n                            (CWD/morpheus.json by default)\n  -f, --force               Overwrite existing configuration file if it exists\n\nDESCRIPTION\n  Initialize a new Morpheus configuration file with database connection settings\n\nEXAMPLES\n  $ morpheus init\n\n  $ morpheus init --force\n\n  $ morpheus init --config ./custom-path/morpheus.json\n\n  $ morpheus init --config .config.json --force\n```\n\n_See code: [src/commands/init.ts](https://github.com/marianozunino/morpheus/blob/v4.5.2/src/commands/init.ts)_\n\n## `morpheus migrate`\n\nExecute pending database migrations in sequential order\n\n```\nUSAGE\n  $ morpheus migrate [--json] [--debug] [-c \u003cvalue\u003e] [-m \u003cvalue\u003e] [-h \u003cvalue\u003e] [-p \u003cvalue\u003e] [-s \u003cvalue\u003e] [-P\n    \u003cvalue\u003e] [-u \u003cvalue\u003e] [-d \u003cvalue\u003e] [--dry-run] [--transaction-mode PER_MIGRATION|PER_STATEMENT]\n\nFLAGS\n  -P, --password=\u003cvalue\u003e           Neo4j password. Env: 'MORPHEUS_PASSWORD'\n  -c, --configFile=\u003cvalue\u003e         [default: /home/runner/work/morpheus/morpheus/morpheus.json] Path to the morpheus\n                                   file (CWD/morpheus.json by default)\n  -d, --database=\u003cvalue\u003e           Neo4j database. Env: 'MORPHEUS_DATABASE'\n  -h, --host=\u003cvalue\u003e               Neo4j host. Env: 'MORPHEUS_HOST'\n  -m, --migrationsPath=\u003cvalue\u003e     [default: neo4j/migrations] Migrations path. Env: 'MORPHEUS_MIGRATIONS_PATH'\n  -p, --port=\u003cvalue\u003e               Neo4j port. Env: 'MORPHEUS_PORT'\n  -s, --scheme=\u003cvalue\u003e             Neo4j scheme. Env: 'MORPHEUS_SCHEME'\n  -u, --username=\u003cvalue\u003e           Neo4j username. Env: 'MORPHEUS_USERNAME'\n      --dry-run                    Perform a dry run - no changes will be made to the database\n      --transaction-mode=\u003coption\u003e  [default: PER_MIGRATION] Transaction mode\n                                   \u003coptions: PER_MIGRATION|PER_STATEMENT\u003e\n\nGLOBAL FLAGS\n  --debug  Enable debug logging\n  --json   Format output as json.\n\nDESCRIPTION\n  Execute pending database migrations in sequential order\n\nEXAMPLES\n  $ morpheus migrate\n\n  $ morpheus migrate -m ~/path/to/migrations\n\n  $ morpheus migrate --config ./custom-config.json\n\n  $ morpheus migrate --dry-run\n\n  $ morpheus migrate --transaction-mode=PER_STATEMENT\n```\n\n_See code: [src/commands/migrate.ts](https://github.com/marianozunino/morpheus/blob/v4.5.2/src/commands/migrate.ts)_\n\n## `morpheus validate`\n\nValidate migration state between local files and database\n\n```\nUSAGE\n  $ morpheus validate [--json] [--debug] [-c \u003cvalue\u003e] [-m \u003cvalue\u003e] [-h \u003cvalue\u003e] [-p \u003cvalue\u003e] [-s \u003cvalue\u003e] [-P\n    \u003cvalue\u003e] [-u \u003cvalue\u003e] [-d \u003cvalue\u003e] [--fail-fast] [-o \u003cvalue\u003e] [--summary-only]\n\nFLAGS\n  -P, --password=\u003cvalue\u003e        Neo4j password. Env: 'MORPHEUS_PASSWORD'\n  -c, --configFile=\u003cvalue\u003e      [default: /home/runner/work/morpheus/morpheus/morpheus.json] Path to the morpheus file\n                                (CWD/morpheus.json by default)\n  -d, --database=\u003cvalue\u003e        Neo4j database. Env: 'MORPHEUS_DATABASE'\n  -h, --host=\u003cvalue\u003e            Neo4j host. Env: 'MORPHEUS_HOST'\n  -m, --migrationsPath=\u003cvalue\u003e  [default: neo4j/migrations] Migrations path. Env: 'MORPHEUS_MIGRATIONS_PATH'\n  -o, --output-file=\u003cvalue\u003e     Write detailed validation results to a JSON file\n  -p, --port=\u003cvalue\u003e            Neo4j port. Env: 'MORPHEUS_PORT'\n  -s, --scheme=\u003cvalue\u003e          Neo4j scheme. Env: 'MORPHEUS_SCHEME'\n  -u, --username=\u003cvalue\u003e        Neo4j username. Env: 'MORPHEUS_USERNAME'\n      --fail-fast               Exit with error code on first validation failure\n      --summary-only            Show only the summary of validation failures\n\nGLOBAL FLAGS\n  --debug  Enable debug logging\n  --json   Format output as json.\n\nDESCRIPTION\n  Validate migration state between local files and database\n\n  Validates that all migrations in the migrations folder have been applied to the database\n  in the correct order and with matching checksums. Reports discrepancies.\n\nEXAMPLES\n  $ morpheus validate\n\n  $ morpheus validate -m ~/path/to/migrations\n\n  $ morpheus validate --config ./custom-config.json\n\n  $ morpheus validate --fail-fast\n\n  $ morpheus validate --summary-only\n\n  $ morpheus validate --output-file=validation-report.json\n\n  $ morpheus validate --debug\n```\n\n_See code: [src/commands/validate.ts](https://github.com/marianozunino/morpheus/blob/v4.5.2/src/commands/validate.ts)_\n\u003c!-- commandsstop --\u003e\n\n# NestJs Integration \u003ca href=\"http://nestjs.com/\" target=\"blank\"\u003e\u003cimg src=\"https://nestjs.com/img/logo-small.svg\" width=\"25\" alt=\"Nest Logo\" /\u003e\u003c/a\u003e\n\n### Module Usage\n\n```ts\nimport { MorpheusModule, MorpheusService,  Neo4jConfig, Neo4jScheme  } from '../../dist/nestjs';\nimport { Module, Injectable } from '@nestjs/common';\nimport { ConfigModule } from '@nestjs/config';\n\n@Module({\n  imports: [MorpheusModule, ConfigModule.forRoot()],\n  providers: [MigrationsService],\n})\nexport class MigrationsModule {}\n\n@Injectable()\nexport class MigrationsService {\n  constructor(\n    private readonly morpheusService: MorpheusService,\n    private readonly configService: ConfigService,\n  ) {}\n\n  async onApplicationBootstrap() {\n    // When no config is provided, the default config is used\n    // -\u003e morpheus.json\n    // -\u003e moprheus environment variables\n\n    await this.morpheusService.cleanDatabase(); // NOTE: You probably don't want to do this, specially in production\n    await this.morpheusService.runMigrations();\n\n    // Use the ConfigService to access the environment variables\n    const configs: Neo4jConfig[] = [\n      {\n        scheme: Neo4jScheme.BOLT,\n        host: 'localhost',\n        port: 7687,\n        username: 'neo4j',\n        password: 'password',\n        migrationsPath: '../neo4j/migrations',\n      },\n    ];\n\n    for (const config of configs) {\n      // Clean and run migrations\n      await this.morpheusService.cleanDatabase(config); // NOTE: You probably don't want to do this, specially in production\n      await this.morpheusService.runMigrations(config);\n    }\n  }\n}\n```\n\n# How it works\n\nThe approach is simple. Morpheus will read all migrations in the `neo4j/migrations` directory and execute them in order.\n\nFor each migration, Morpheus will create a transaction and execute the migration. Thus a migration may contain multiple Cypher statements (**each statement must end with `;`**).\n\nOnce a migration file is executed, Morpheus will keep track of the migration and will not execute it again.\n\nExisting migration files that have already been executed **can not** be modified since they are stored in a database with their corresponding checksum (crc32).\n\nIf you want to revert a migration, create a new migration and revert the changes.\n\n## How does neo4j keep track of the migrations?\n\nYou can take a look at schema and explanation on [Michael's README](https://michael-simons.github.io/neo4j-migrations/2.2.0/#concepts_chain) - there's a neat graph that shows the migration chain.\n\n### Contributing\nContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarianozunino%2Fmorpheus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarianozunino%2Fmorpheus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarianozunino%2Fmorpheus/lists"}