mi / mongodb-migrations
Library to migrate forward and backward in mongodb.
Installs: 1 058
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/mi/mongodb-migrations
Requires
- php: ^5.6|^7.0
- ext-mongodb: *
- matthiasnoback/symfony-bundle-plugins: ^1.1
- mongodb/mongodb: ^1.0
- ocramius/proxy-manager: ^1.0
- puli/repository: ^1.0@beta
- symfony/console: ^2.7
- symfony/filesystem: ^2.7
- zendframework/zend-code: ^2.0
Requires (Dev)
This package is not auto-updated.
Last update: 2020-02-07 09:31:27 UTC
README
Overview
...
Installation
Composer
for PHP 7 and greater with the new mongoDB-extension
composer require mi/mongodb-migrations
for other PHP-Versions
composer require mi/mongodb-migrations ^1.0.0@beta
Puli-Bindings
MY_BUNDLE_ALIAS = the alias of your bundle (for example my_awesome_bundle)
puli bind --class Mi\\MongoDb\\Migration\\DependencyInjection\\MigrationPlugin Matthias\\BundlePlugins\\BundlePlugin --param bundle-alias=<MY_BUNDLE_ALIAS>
puli bind /mi/mongodb-migrations/*.xml mi/service
puli build
Configuration
my_awesome_bundle:
    ...
    
    migration:
        path: '/path/to/version/class/directory'                            // path where versions will be constructed
        xml_path: '/path/to/version/service-definition/file'                // service-definitions where versions will be defined
        namespace: "namespace\\of\\generated\\versions"                     // namespace versions will be constructed with
        migration_collection: 'migration.collection.service.definition.id'  // need to be from type MongoCollection
refresh autoloader
add namespace namespace\\of\\generated\\versions to autoloader and execute
composer dump-autoload
Usage
create version
console mi:mongo-db:migration:generate
execute migration
console mi:mongo-db:migration:migrate
Contributing
- Fork it
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request
License
This library is under the MIT license.