Skip to content

Commit

Permalink
CampaignChain/campaignchain#206 Include system upgrade routines for s…
Browse files Browse the repository at this point in the history
…chema and data
  • Loading branch information
groganz committed Jul 26, 2016
1 parent af74e40 commit a34253a
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ce/developer/cookbook/module_update.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Creating Update Routines for Your Module
========================================

When you `update a CampaignChain installation`_, the automatic update
functionality takes the update routines provided with each CampaignChain module
and applies them to the database schema and user-generated data (e.g. data in
the database or in the file system).
When you :doc:`update a CampaignChain installation </ce/administrator/deployment/update>`,
the automatic update functionality takes the update routines provided with each
CampaignChain module and applies them to the database schema and user-generated
data (e.g. data in the database or in the file system).

When developing your own modules, it is best practice to include such update
routines as soon as something changes in your module that affects the database
Expand Down Expand Up @@ -295,6 +295,5 @@ of your CampaignChain installation:
.. _installed CampaignChain as explained in the README.md file: https://github.com/CampaignChain/campaignchain/blob/master/README.md#installation
.. _contact us: http://www.campaignchain.com/contact
.. _Composer package name: https://getcomposer.org/doc/04-schema.md#name
.. _update a CampaignChain installation: :doc:`/ce/administrator/deployment/update`
.. _Doctrine Migration Bundle: http://symfony.com/doc/current/bundles/DoctrineMigrationsBundle/index.html
.. _tagged Symfony services: http://symfony.com/doc/current/components/dependency_injection/tags.html
10 changes: 10 additions & 0 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ Tips & tricks for marketers to make the best use of CampaignChain.

user/index

Packages
--------

Find the documentation for single packages included in CampaignChain below.

.. toctree::
:maxdepth: 2

package/campaignchain_update

Contributing to Documentation
-----------------------------

Expand Down
74 changes: 74 additions & 0 deletions package/campaignchain_update.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
Update Package
==============

The update feature is a package that is included in CampaignChain by default and
can also be used independently from CampaignChain as a regular Symfony bundle.

The update package offers you the ability to include update routines in multiple
separate CampaignChain modules or Symfony bundles. Essentially, it extends the
`DoctrineMigrationsBundle`_.

Installation
------------

CampaignChain
~~~~~~~~~~~~~

The ``campaignchain/update` Composer package is included in any CampaignChain
distribution by default. It will be installed automatically.
Symfony
~~~~~~~
First, install the package with
.. code-block:: bash
$ composer require campaignchain/update "dev-master"
If everything worked, the update package can now be found at
``vendor/campaignchain/update``.

Finally, be sure to enable the bundle in ``AppKernel.php`` by including the
following:

.. code-block:: php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
//...
new CampaignChain\UpdateBundle\CampaignChainUpdateBundle(),
);
}
Configuration
-------------

You can configure the default package name and the target directories for the
schema and update files in your ``config.yml``. The examples below are the
default values:

.. code-block:: yaml
campaignchain_update:
diff_package: campaignchain/core
bundle:
schema_dir: /Resources/update/schema
data_dir: /Resources/update/data
Usage
-----

Learn how to use the update package in the tutorial on
:doc:`creating update routines </ce/developer/cookbook/module_update>`.

Issues
------

Please post reports, questions, suggestions, etc. at
https://github.com/CampaignChain/update/issues.

.. _DoctrineMigrationsBundle: https://symfony.com/doc/current/bundles/DoctrineMigrationsBundle/index.html
.. _CampaignChain/update: https://github.com/CampaignChain/update
10 changes: 10 additions & 0 deletions package/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Packages
========

This part of the documentation covers some of the modules included in or
available for CampaignChain.

.. toctree::
:maxdepth: 2

campaignchain_update

0 comments on commit a34253a

Please sign in to comment.