Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
## Разработка
Backend разработка – https://github.com/profcomff/.github/wiki/%5Bdev%5D-Backend-разработка

CONTRIBUTING.md - [CONTRIBUTING.md](services-api/CONTRIBUTING.md)
CONTRIBUTING.md - [CONTRIBUTING.md](CONTRIBUTING.md)

## Quick Start

Expand Down Expand Up @@ -64,5 +64,5 @@ foo@bar:~$ python -m services-backend

Backend разработка – https://github.com/profcomff/.github/wiki/%5Bdev%5D-Backend-разработка

CONTRIBUTING.md - [CONTRIBUTING.md](services-api/CONTRIBUTING.md)
CONTRIBUTING.md - [CONTRIBUTING.md](CONTRIBUTING.md)

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Fixing
"""End-to-end numbering fix

Revision ID: d35e88f39f85
Revises: 660bb7891726
Expand Down
42 changes: 42 additions & 0 deletions migrations/versions/d6b21dcb2c75_enum_type_button_fix.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"""enum type button fix

Revision ID: d6b21dcb2c75
Revises: d35e88f39f85
Create Date: 2023-04-11 14:21:54.007129

"""
import sqlalchemy as sa
from alembic import op


# revision identifiers, used by Alembic.
revision = 'd6b21dcb2c75'
down_revision = 'd35e88f39f85'
branch_labels = None
depends_on = None


def upgrade():
conn = op.get_bind()
res_b = conn.execute(sa.text("select * from button")).fetchall()
for i in range(len(res_b)):
conn.execute(
sa.text(
f"""UPDATE "button"
SET "type"=UPPER('{res_b[i][6]}')
WHERE id={res_b[i][0]}"""
)
)


def downgrade():
conn = op.get_bind()
res_b = conn.execute(sa.text("select * from button")).fetchall()
for i in range(len(res_b)):
conn.execute(
sa.text(
f"""UPDATE "button"
SET "type"=LOWER('{res_b[i][6]}')
WHERE id={res_b[i][0]}"""
)
)
3 changes: 2 additions & 1 deletion services_backend/routes/models/button.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from pydantic import Field

from ...models.database import Type
from services_backend.models.database import Type

from .base import Base


Expand Down