A console application to generate migrations for Graviton based services
This is a Symfony Console application that provides utilities in regard to generation and migration of Graviton based services and service definitions.
When we generate migrations, we generate classes that can be used with
This is a fairly new project and generation migrations is no simple matter.
migrationkit has been designed in an extendable way, so we can add new migration scenarios rather easily.
|Rename of a property on an existing entity||✅|
|Filling of newly required fields||🚫|
|Moving of entities||🚫|
|More complex stuff.. what?||🚫|
The recommended way to use this is by using our docker image. It is available on Docker Hub, so you can use it right away.
You can execute the tool quite easily:
docker run --rm graviton/migrationkit
You should see the help screen with the list of commands.
To execute a given command, just add it to the
docker run --rm graviton/migrationkit graviton:migrations:generate --help
Feel free to wrap this with Docker Compose.
Our Docker Image comes with some support for solving user permission problems as it shall generate resources on your local disk.
The image has the environment variables
PGID that you should set to the UID and GID of
local user that owns the target directories.
You can locate the UID and GID by issuing the
user@host:~$ id uid=1000(user) gid=1000(user) groups=1000(user),...
Once you know that, set those on the
docker run --rm -e PUID=1000 -e PGID=1000 graviton/migrationkit graviton:migrations:generate --help
This should resolve all permission problems.
If you really want to use this in a project context, you can use composer:
composer require --dev graviton/migrationkit
This really should be a
dev dependency for your project.
Generate migrations from your current branch to another branch and generate migrations
Assumes that the directory passed as
baseDir is a git repository. It then copies
that directory, switches to the tag/branch defined by argument
calls the command
graviton:migrations:generate with those two directory,
thus allowing you to generate differences between two (possibly unpushed) branches.
One would pull
develop, create a feature branch, make his changes and then
call this command with
develop as a compare branch.
Generate random JSON payload entities according to a service definition.
This is a helper command for general work on migrations. It takes a service
definition and generates
number (argument) files (default 10) of random fake
JSON payloads that can be
POSTed to a Graviton instance.
They conform to the specified service definition and include all specified fields.
Please note that these fake data payloads may make no sense to an application that wants to understand/do business stuff out of the structures.
In order to generate valid
extref fields, you may have to specify an
--refMap to the command).
This is a simple YAML file that maps the
Collection attribute in the field to an URL.
App: /core/app/ MyOtherEntity: /other/entity/
Generates YML metadata files from service definitions
migrationkit uses simple YAML files to do stuff. This command helps
to generate those files. You need those files for example for the
Generate service definitions from the iOS Schema
This fills a specific need for people that want to generate Graviton compatible service definitions from a proprietary iOS Schema format.
Lower level migration command that allows you to specify two directories and migrate between them.
Allows you to specify two directories and generate migrations from them. It will prompt you for possible conflicts and you may need to provide input to resolve them.