Skip to content

Commit bc209c4

Browse files
committed
Update composer instructions and fix some documentation
1 parent 1022552 commit bc209c4

File tree

2 files changed

+26
-38
lines changed

2 files changed

+26
-38
lines changed

README.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This bundle integrates the [Doctrine2 Migrations library](http://www.doctrine-pr
55
into Symfony so that you can safely and quickly manage database migrations.
66

77
Documentation on how to install and use this bundle is available in the
8-
Symfony2 [documentation](http://symfony.com/doc/current/bundles/DoctrineMigrationsBundle/index.html).
8+
Symfony2 [documentation](https://symfony.com/doc/current/bundles/DoctrineMigrationsBundle/index.html).
99

1010
WARNING: Namespace changed
1111
==========================

Resources/doc/index.rst

Lines changed: 25 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,11 @@ Installation
1616
Doctrine migrations for Symfony are maintained in the `DoctrineMigrationsBundle`_.
1717
The bundle uses external `Doctrine Database Migrations`_ library.
1818

19-
Follow these steps to install the bundle and the library in the Symfony
20-
Standard edition. Add the following to your ``composer.json`` file:
21-
22-
.. code-block:: json
23-
24-
{
25-
"require": {
26-
"doctrine/migrations": "^1.0",
27-
"doctrine/doctrine-migrations-bundle": "^1.0"
28-
}
29-
}
30-
31-
Update the vendor libraries:
19+
First, install the bundle with composer:
3220

3321
.. code-block:: bash
3422
35-
$ php composer.phar update
23+
$ composer require doctrine/doctrine-migrations-bundle "^1.0"
3624
3725
If everything worked, the ``DoctrineMigrationsBundle`` can now be found
3826
at ``vendor/doctrine/doctrine-migrations-bundle``.
@@ -56,11 +44,11 @@ following:
5644
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
5745
);
5846
}
59-
47+
6048
Configuration
6149
-------------
6250

63-
You can configure the path, namespace, table_name and name in your `config.yml`. The examples below are the default values.
51+
You can configure the path, namespace, table_name and name in your ``config.yml``. The examples below are the default values.
6452

6553
.. code-block:: yaml
6654
@@ -69,7 +57,7 @@ You can configure the path, namespace, table_name and name in your `config.yml`.
6957
dir_name: "%kernel.root_dir%/DoctrineMigrations"
7058
namespace: Application\Migrations
7159
table_name: migration_versions
72-
name: Application Migrations
60+
name: Application Migrations
7361
7462
Usage
7563
-----
@@ -112,7 +100,7 @@ for you.
112100

113101
.. code-block:: bash
114102
115-
php app/console doctrine:migrations:generate
103+
$ php app/console doctrine:migrations:generate
116104
Generated new migration class to "/path/to/project/app/DoctrineMigrations/Version20100621140655.php"
117105
118106
Have a look at the newly generated migration class and you will see something
@@ -141,7 +129,7 @@ migration to execute:
141129

142130
.. code-block:: bash
143131
144-
php app/console doctrine:migrations:status --show-versions
132+
$ php app/console doctrine:migrations:status --show-versions
145133
146134
== Configuration
147135
@@ -165,7 +153,7 @@ finally migrate when you're ready:
165153

166154
.. code-block:: bash
167155
168-
php app/console doctrine:migrations:migrate 20100621140655
156+
$ php app/console doctrine:migrations:migrate 20100621140655
169157
170158
For more information on how to write the migrations themselves (i.e. how to
171159
fill in the ``up()`` and ``down()`` methods), see the official Doctrine Migrations
@@ -268,7 +256,7 @@ running the following command:
268256

269257
.. code-block:: bash
270258
271-
php app/console doctrine:migrations:diff
259+
$ php app/console doctrine:migrations:diff
272260
273261
You should see a message that a new migration class was generated based on
274262
the schema differences. If you open this file, you'll find that it has the
@@ -277,7 +265,7 @@ to add the table to your database:
277265

278266
.. code-block:: bash
279267
280-
php app/console doctrine:migrations:migrate
268+
$ php app/console doctrine:migrations:migrate
281269
282270
The moral of the story is this: after each change you make to your Doctrine
283271
mapping information, run the ``doctrine:migrations:diff`` command to automatically
@@ -294,7 +282,7 @@ Container Aware Migrations
294282

295283
In some cases you might need access to the container to ensure the proper update of
296284
your data structure. This could be necessary to update relations with some specific
297-
logic or to create new entities.
285+
logic or to create new entities.
298286

299287
Therefore you can just implement the ContainerAwareInterface with its needed methods
300288
to get full access to the container.
@@ -307,19 +295,19 @@ to get full access to the container.
307295
308296
class Version20130326212938 extends AbstractMigration implements ContainerAwareInterface
309297
{
310-
298+
311299
private $container;
312-
300+
313301
public function setContainer(ContainerInterface $container = null)
314302
{
315303
$this->container = $container;
316304
}
317-
305+
318306
public function up(Schema $schema)
319307
{
320308
// ... migration content
321309
}
322-
310+
323311
public function postUp(Schema $schema)
324312
{
325313
$converter = $this->container->get('my_service.convert_data_to');
@@ -330,29 +318,29 @@ to get full access to the container.
330318
Manual Tables
331319
-------------
332320

333-
It is a common use case, that in addition to your generated database structure
334-
based on your doctrine entities you might need custom tables. By default such
321+
It is a common use case, that in addition to your generated database structure
322+
based on your doctrine entities you might need custom tables. By default such
335323
tables will be removed by the doctrine:migrations:diff command.
336324

337-
If you follow a specific scheme you can configure doctrine/dbal to ignore those
338-
tables. Let's say all custom tables will be prefixed by ``t_``. In this case you
325+
If you follow a specific scheme you can configure doctrine/dbal to ignore those
326+
tables. Let's say all custom tables will be prefixed by ``t_``. In this case you
339327
just have to add the following configuration option to your doctrine configuration:
340328

341329
.. configuration-block::
342330

343331
.. code-block:: yaml
344-
332+
345333
doctrine:
346-
dbal:
334+
dbal:
347335
schema_filter: ~^(?!t_)~
348-
336+
349337
.. code-block:: xml
350-
338+
351339
<doctrine:dbal schema-filter="~^(?!t_)~" ... />
352340
353-
341+
354342
.. code-block:: php
355-
343+
356344
$container->loadFromExtension('doctrine', array(
357345
'dbal' => array(
358346
'schema_filter' => '~^(?!t_)~',

0 commit comments

Comments
 (0)