Skip to content

Commit ee87fa0

Browse files
Minor fixups to FAB DB command docs (apache#42377)
1 parent 4d7fad3 commit ee87fa0

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

contributing-docs/13_metadata_database_updates.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ This guide will show you how to hook your application into Airflow's migration p
5858

5959
Subclass the BaseDBManager
6060
==========================
61-
To hook your application into Airflow's migration process, you need to subclass the BaseDBManager class from the
62-
airflow.utils.db_manager.py module. This class provides methods for running Alembic migrations.
61+
To hook your application into Airflow's migration process, you need to subclass the ``BaseDBManager`` class from the
62+
``airflow.utils.db_manager`` module. This class provides methods for running Alembic migrations.
6363

6464
Create Alembic migration scripts
6565
================================
66-
At the root of your application, run "alembic init migrations" to create a new migrations directory. Set
66+
At the root of your application, run "alembic init migrations" to create a new migrations directory. Set the
6767
``version_table`` variable in the ``env.py`` file to the name of the table that stores the migration history. Specify this
6868
version_table in the ``version_table`` argument of the alembic's ``context.configure`` method of the ``run_migration_online``
6969
and ``run_migration_offline`` functions. This will ensure that your application's migrations are stored in a separate
@@ -74,10 +74,10 @@ migrations. This too should be specified in the ``context.configure`` method of
7474

7575
Next, set the config_file not to disable existing loggers:
7676

77-
```python
78-
if config.config_file_name is not None:
79-
fileConfig(config.config_file_name, disable_existing_loggers=False)
80-
```
77+
.. code-block:: python
78+
79+
if config.config_file_name is not None:
80+
fileConfig(config.config_file_name, disable_existing_loggers=False)
8181
8282
Replace the content of your application's ``alembic.ini`` file with Airflow's ``alembic.ini`` copy.
8383

docs/apache-airflow-providers-fab/migrations-ref.rst

+2-7
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,9 @@ Here's the list of all the Database Migrations that are executed via when you ru
2323
.. warning::
2424

2525
Those migration details are mostly used here to make the users aware when and what kind of migrations
26-
will be executed during migrations between specific Airflow versions. The intention here is that the
26+
will be executed during migrations between specific FAB provider versions. The intention here is that the
2727
"DB conscious" users might perform an analysis on the migrations and draw conclusions about the impact
28-
of the migrations on their Airflow database. Those users might also want to take a look at the
29-
:doc:`apache-airflow:database-erd-ref` document to understand how the internal DB of Airflow structure looks like.
30-
However, you should be aware that the structure is internal and you should not access the DB directly
31-
to retrieve or modify any data - you should use the :doc:`REST API <stable-rest-api-ref>` to do that instead.
32-
33-
28+
of the migrations on their Airflow database.
3429

3530
.. This table is automatically updated by pre-commit by ``scripts/ci/pre_commit/migration_reference.py``
3631
.. All table elements are scraped from migration files

0 commit comments

Comments
 (0)