Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions docs/source/infrastructure/database-migration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ A) DEV Migration + Testing (Steps 1–6)

.. code-block:: bash

export DATABASE_URL=dev_database_url
export DATABASE_URL="postgresql://user_name:password@host:5432/db_name"

alembic revision --autogenerate -m "description"

This generates a new file in ``alembic/versions/``. **Always review the file before applying** — Alembic cannot
Expand All @@ -51,14 +52,16 @@ A) DEV Migration + Testing (Steps 1–6)

.. code-block:: bash

export DATABASE_URL=dev_database_url
export DATABASE_URL="postgresql://user_name:password@host:5432/db_name"

alembic upgrade head --sql

4. **Apply migration to DEV**

.. code-block:: bash

export DATABASE_URL=dev_database_url
export DATABASE_URL="postgresql://user_name:password@host:5432/db_name"

alembic current
alembic upgrade head

Expand All @@ -71,7 +74,8 @@ A) DEV Migration + Testing (Steps 1–6)

.. code-block:: bash

export DATABASE_URL=dev_database_url
export DATABASE_URL="postgresql://user_name:password@host:5432/db_name"

alembic downgrade -1

Make sure the downgrade works as expected.
Expand All @@ -87,7 +91,8 @@ B) PROD Verification + Deployment (Steps 7–10)

.. code-block:: bash

export DATABASE_URL=dev_database_url
export DATABASE_URL="postgresql://user_name:password@host:5432/db_name"

alembic current
alembic upgrade head

Expand Down
Loading