Skip to content

Commit 5c8f128

Browse files
committed
Merge branch '2.0.x'
* 2.0.x: Update doc migrations namespace Minor improvements in the docs Merge pull request #262 from pyatnitsev/patch-1
2 parents 8e54482 + 5b33d0d commit 5c8f128

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

Resources/doc/index.rst

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ Installation
1515

1616
Run this command in your terminal:
1717

18-
.. code-block:: bash
18+
.. code-block:: terminal
1919
2020
$ composer require doctrine/doctrine-migrations-bundle "^2.0"
2121
22-
If you don't use Symfony Flex, you must enable the bundle manually in the application:
22+
If you don't use `Symfony Flex`_, you must enable the bundle manually in the application:
2323

2424
.. code-block:: php
2525
@@ -59,7 +59,7 @@ Usage
5959

6060
All of the migrations functionality is contained in a few console commands:
6161

62-
.. code-block:: bash
62+
.. code-block:: terminal
6363
6464
doctrine
6565
doctrine:migrations:diff [diff] Generate a migration by comparing your current database to your mapping information.
@@ -76,7 +76,7 @@ All of the migrations functionality is contained in a few console commands:
7676
Start by getting the status of migrations in your application by running
7777
the ``status`` command:
7878

79-
.. code-block:: bash
79+
.. code-block:: terminal
8080
8181
$ php bin/console doctrine:migrations:status
8282
@@ -89,7 +89,7 @@ the ``status`` command:
8989
>> Configuration Source: manually configured
9090
>> Version Table Name: migration_versions
9191
>> Version Column Name: version
92-
>> Migrations Namespace: App\Migrations
92+
>> Migrations Namespace: DoctrineMigrations
9393
>> Migrations Directory: /path/to/project/app/Migrations
9494
>> Previous Version: Already at first version
9595
>> Current Version: 0
@@ -104,7 +104,7 @@ Now, you can start working with migrations by generating a new blank migration
104104
class. Later, you'll learn how Doctrine can generate migrations automatically
105105
for you.
106106

107-
.. code-block:: bash
107+
.. code-block:: terminal
108108
109109
$ php bin/console doctrine:migrations:generate
110110
Generated new migration class to "/path/to/project/app/Migrations/Version20180605025653.php"
@@ -120,7 +120,7 @@ like the following:
120120
121121
declare(strict_types=1);
122122
123-
namespace App\Migrations;
123+
namespace DoctrineMigrations;
124124
125125
use Doctrine\DBAL\Schema\Schema;
126126
use Doctrine\Migrations\AbstractMigration;
@@ -151,7 +151,7 @@ like the following:
151151
If you run the ``status`` command it will now show that you have one new
152152
migration to execute:
153153

154-
.. code-block:: bash
154+
.. code-block:: terminal
155155
156156
$ php bin/console doctrine:migrations:status --show-versions
157157
@@ -182,7 +182,7 @@ migration to execute:
182182
Now you can add some migration code to the ``up()`` and ``down()`` methods and
183183
finally migrate when you're ready:
184184

185-
.. code-block:: bash
185+
.. code-block:: terminal
186186
187187
$ php bin/console doctrine:migrations:migrate 20180605025653
188188
@@ -191,6 +191,7 @@ fill in the ``up()`` and ``down()`` methods), see the official Doctrine Migratio
191191
`documentation`_.
192192

193193
.. tip::
194+
194195
If you need to use another database connection to execute migrations you may use option ``--db="doctrine-connection-name"``
195196
where ``doctrine-connection-name`` is valid Doctrine connection defined in doctrine.yaml
196197

@@ -217,7 +218,7 @@ Skipping Migrations
217218

218219
You can skip single migrations by explicitly adding them to the ``migration_versions`` table:
219220

220-
.. code-block:: bash
221+
.. code-block:: terminal
221222
222223
$ php bin/console doctrine:migrations:version YYYYMMDDHHMMSS --add
223224
@@ -299,7 +300,7 @@ With this information, Doctrine is now ready to help you persist your new
299300
doesn't exist yet! Generate a new migration for this table automatically by
300301
running the following command:
301302

302-
.. code-block:: bash
303+
.. code-block:: terminal
303304
304305
$ php bin/console doctrine:migrations:diff
305306
@@ -308,7 +309,7 @@ the schema differences. If you open this file, you'll find that it has the
308309
SQL code needed to create the ``user`` table. Next, run the migration
309310
to add the table to your database:
310311

311-
.. code-block:: bash
312+
.. code-block:: terminal
312313
313314
$ php bin/console doctrine:migrations:migrate
314315
@@ -325,7 +326,7 @@ for your project.
325326
If you don't want to use this workflow and instead create your schema via
326327
``doctrine:schema:create``, you can tell Doctrine to skip all existing migrations:
327328

328-
.. code-block:: bash
329+
.. code-block:: terminal
329330
330331
$ php bin/console doctrine:migrations:version --add --all
331332
@@ -336,7 +337,7 @@ Manual Tables
336337

337338
It is a common use case, that in addition to your generated database structure
338339
based on your doctrine entities you might need custom tables. By default such
339-
tables will be removed by the doctrine:migrations:diff command.
340+
tables will be removed by the ``doctrine:migrations:diff`` command.
340341

341342
If you follow a specific scheme you can configure doctrine/dbal to ignore those
342343
tables. Let's say all custom tables will be prefixed by ``t_``. In this case you
@@ -373,3 +374,4 @@ will need to be placed per-connection.
373374
.. _documentation: https://www.doctrine-project.org/projects/doctrine-migrations/en/current/index.html
374375
.. _DoctrineMigrationsBundle: https://github.com/doctrine/DoctrineMigrationsBundle
375376
.. _`Doctrine Database Migrations`: https://github.com/doctrine/migrations
377+
.. _`Symfony Flex`: https://symfony.com/doc/current/setup/flex.html

0 commit comments

Comments
 (0)