Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.
Merged
Changes from 2 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
16 changes: 12 additions & 4 deletions alembic/README → alembic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,30 @@ The following steps should be followed in the Python environment configured for

1. Make sure the environment variables with the database connection details are loaded into the environment. If you are using Azure instance, you will additionally need to make sure it's using the same environment variables to be connected to the database on Azure, as that's in the current state and does not require changes, but to make sure about that, we need to do the next step check.

2. As an initial check, make sure the database is up to date with the head of changes. (If it is not, this step tries to run the migration one by one):
These are the variables that you need to change:
- `POSTGRES_USERNAME`
- `POSTGRES_PASSWORD`
- `POSTGRES_HOST`
- `POSTGRES_PORT`
- `POSTGRES_DB`

3. As an initial check, make sure the database is up to date with the head of changes. (If it is not, this step tries to run the migration one by one):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You removed 2... The rest is fine =)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦‍♂️


```sh
alembic upgrade head
```

3. Create a new revision (Don't forget to update the message)
4. Create a new revision (Don't forget to update the message)

```sh
alembic revision --autogenerate -m "PLACE HOLDER FOR MESSAGE"
```

4. Open the generated migration script under `alembic/versions` and adjust it accordingly by implementing the upgrade function with Alembic operations. `downgrade` function could be left untouched as we don't support downgrade at this time.
5. Open the generated migration script under `alembic/versions` and adjust it accordingly by implementing the upgrade function with Alembic operations. `downgrade` function could be left untouched as we don't support downgrade at this time.

5. Update the database with a head of changes. Alemtic automatically picks up the new migration script and executes it.
6. Update the database with a head of changes. Alemtic automatically picks up the new migration script and executes it.

```sh
alembic upgrade head
```

Loading