Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Commit 080a4ca

Browse files
safeamiiirstr-angerjatinriverlane
authored
fix: db migration rename task id to UUID (#234)
* fix(database): a fix in the db migration using alembic, renaming task_id into uuid * fix(doc): update alembic README file * docs(alembic): update the language Co-authored-by: Stanislav Protasov <[email protected]> Signed-off-by: AmirReza <[email protected]> * docs(alembic): update the language again Co-authored-by: Jatin <[email protected]> Signed-off-by: AmirReza <[email protected]> --------- Signed-off-by: AmirReza <[email protected]> Co-authored-by: Stanislav Protasov <[email protected]> Co-authored-by: Jatin <[email protected]>
1 parent 8381e02 commit 080a4ca

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

alembic/README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ The following steps should be followed in the Python environment configured for
88

99
> **NOTE:** Always assume the database is populated with existing data!
1010

11-
1. Make sure the environment variables with the database connection details are loaded into the environment.
11+
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.
1212

13-
2. 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):
13+
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):
1414

1515
```sh
1616
alembic upgrade head

alembic/versions/c12374978a12_rename_task_id_to_uuid.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,23 @@
55
Create Date: 2024-10-11 11:44:29.159937
66
77
"""
8+
89
from typing import Sequence, Union
910

10-
from alembic import op
1111
import sqlalchemy as sa
1212

13+
from alembic import op
1314

1415
# revision identifiers, used by Alembic.
15-
revision: str = 'c12374978a12'
16-
down_revision: Union[str, None] = '6d5f957d035c'
16+
revision: str = "c12374978a12"
17+
down_revision: Union[str, None] = "6d5f957d035c"
1718
branch_labels: Union[str, Sequence[str], None] = None
1819
depends_on: Union[str, Sequence[str], None] = None
1920

2021

2122
def upgrade() -> None:
2223
# ### commands auto generated by Alembic - please adjust! ###
23-
op.alter_column('tasks', 'task_id', new_column_name='uuid')
24+
op.alter_column("task", "task_id", new_column_name="uuid")
2425
# ### end Alembic commands ###
2526

2627

0 commit comments

Comments
 (0)