-
Notifications
You must be signed in to change notification settings - Fork 562
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(db): increase length of the host and sni columns (#1505)
* feat(db): increase length of the host and sni columns * remove unnesserly code
- Loading branch information
1 parent
dab0cdb
commit 8f662d4
Showing
2 changed files
with
67 additions
and
11 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
app/db/migrations/versions/e7b869e999b4_increase_length_of_the_host_and_sni_.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,41 @@ | ||
"""increase length of the host and sni columns | ||
Revision ID: e7b869e999b4 | ||
Revises: be0c5f840473 | ||
Create Date: 2024-12-12 15:41:55.487859 | ||
""" | ||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'e7b869e999b4' | ||
down_revision = 'be0c5f840473' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# Increase the length of 'sni' and 'host' columns to 1000 | ||
with op.batch_alter_table('hosts') as batch_op: | ||
batch_op.alter_column('host', | ||
existing_type=sa.String(length=256), | ||
type_=sa.String(length=1000), | ||
nullable=True) | ||
batch_op.alter_column('sni', | ||
existing_type=sa.String(length=256), | ||
type_=sa.String(length=1000), | ||
nullable=True) | ||
|
||
|
||
def downgrade(): | ||
# Revert the column lengths back to their original size | ||
with op.batch_alter_table('hosts') as batch_op: | ||
batch_op.alter_column('host', | ||
existing_type=sa.String(length=1000), | ||
type_=sa.String(length=256), | ||
nullable=True) | ||
batch_op.alter_column('sni', | ||
existing_type=sa.String(length=1000), | ||
type_=sa.String(length=256), | ||
nullable=True) |
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