-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(BA-432): Enforce VFolder name length restriction through the API …
…schema (#3363) Backported-from: main (24.12) Backported-to: 24.09 Backport-of: 3363
- Loading branch information
Showing
6 changed files
with
161 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Enforce VFolder name length restriction through the API schema, not by the DB column constraint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...end/manager/models/alembic/versions/ef9a7960d234_extend_length_of_vfolders_name_column.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"""extend length of vfolders.name column | ||
Revision ID: ef9a7960d234 | ||
Revises: 0bb88d5a46bf | ||
Create Date: 2025-01-03 16:07:11.407081 | ||
""" | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "ef9a7960d234" | ||
down_revision = "0bb88d5a46bf" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
op.alter_column( | ||
"vfolders", | ||
"name", | ||
existing_type=sa.VARCHAR(length=64), | ||
type_=sa.String(length=128), | ||
existing_nullable=False, | ||
) | ||
|
||
|
||
def downgrade() -> None: | ||
op.alter_column( | ||
"vfolders", | ||
"name", | ||
existing_type=sa.String(length=128), | ||
type_=sa.VARCHAR(length=64), | ||
existing_nullable=False, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters