{"repo":"businho/django-migrations-ci","free":true,"listed":false,"github":"https://github.com/businho/django-migrations-ci","clone":"git clone https://github.com/businho/django-migrations-ci.git","description":"Cached migrations on CI (and local) for faster migrations","language":"Python","stars":34,"topics":["database","django","migrations","python","mysql","postgres","sqlite3"],"license":"MIT","category":"databases-storage","readme_excerpt":"django-migrations-ci Reuse database state on CI. Run migrations on CI tests only for changes. Migrations are slow, but you have to run it on CI for testing reasons, so avoid to run them when the database state was already tested. Install Install the package with pip: Add django migrations ci to Django settings INSTALLED APPS . How to use The command migrateci execute all migrations and save dump files migrateci- . If these files already exist on disk, they are used to prepare the database without running all migrations again. Workflow This is how the \"run test\" CI job should work. It works with pytest-django too as a plugin: The recommended way to work with it is configuring default pytest addopts with --migrateci --reuse-db to run without recreating database. When you want to recreate, run pytest with --create-db that has precedence over --reuse-db . Parallel tests Parallel tests with pytest-django Also check database names for parallel tests. Settings MIGRATECI STORAGE=\"django.core.files.storage.FileSystemStorage\" File storage class. The django-storages package has many backends implemented. Saving cache files to an external storage allow the lib to reuse partial migrations. When you write a new migration, it will try to get a cache without this last migration and load from it, running only the new migrations. An S3 example,, but it works with any custom backend: MIGRATECI LOCATION=\"\" File storage API has a location arg that all backend use in some way. If no storage is def","default_branch":null,"files":null,"tree":[],"storefront":"/r/businho","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/businho/django-migrations-ci/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}