introduction.rst 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. Introduction
  2. ============
  3. The Doctrine Migrations project offers additional functionality on top of the
  4. DBAL_ and ORM_ for versioning your database schema. It makes it easy and safe
  5. to deploy changes to it in a way that can be reviewed and tested before being
  6. deployed to production.
  7. Installation
  8. ------------
  9. You can use the Doctrine Migrations project by installing it with Composer_ or by downloading
  10. the latest PHAR from the releases_ page on GitHub.
  11. For this documentation exercise we will assume you are starting a new project so create a new folder to work in:
  12. .. code-block:: sh
  13. $ mkdir /data/doctrine/migrations-docs-example
  14. $ cd /data/doctrine/migrations-docs-example
  15. Composer
  16. ~~~~~~~~
  17. Now to install with Composer it is as simple as running the following command in your project.
  18. .. code-block:: sh
  19. composer require "doctrine/migrations"
  20. Now you will have a file in ``vendor/bin`` available to run the migrations console application:
  21. .. code-block:: sh
  22. ./vendor/bin/doctrine-migrations
  23. PHAR
  24. ~~~~
  25. To install by downloading the PHAR, you just need to download the latest PHAR file from the
  26. releases_ page on GitHub.
  27. Here is an example using the ``2.0.0`` release:
  28. .. code-block:: sh
  29. wget https://github.com/doctrine/migrations/releases/download/v2.0.0/doctrine-migrations.phar
  30. Now you can execute the PHAR like this:
  31. .. code-block:: sh
  32. php doctrine-migrations.phar
  33. :ref:`Next Chapter: Configuration <configuration>`
  34. .. _Composer: https://getcomposer.org/
  35. .. _DBAL: https://www.doctrine-project.org/projects/dbal.html
  36. .. _ORM: https://www.doctrine-project.org/projects/orm.html
  37. .. _releases: https://github.com/doctrine/migrations/releases