Skip to content

Commit

Permalink
Remove character limit of url field in link model. (#879)
Browse files Browse the repository at this point in the history
  • Loading branch information
abandoned-prototype authored Feb 21, 2022
1 parent 7b009d5 commit 24442c8
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion OpenOversight/app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ class Link(BaseModel):

id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(100), index=True)
url = db.Column(db.String(255), nullable=False)
url = db.Column(db.Text(), nullable=False)
link_type = db.Column(db.String(100), index=True)
description = db.Column(db.Text(), nullable=True)
author = db.Column(db.String(255), nullable=True)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
"""Remove character limit of url field in link model.
Revision ID: 93fc3e074dcc
Revises: cd39b33b5360
Create Date: 2022-01-05 06:50:40.070530
"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "93fc3e074dcc"
down_revision = "cd39b33b5360"
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column(
"links",
"url",
existing_type=sa.VARCHAR(length=255),
type_=sa.Text(),
existing_nullable=False,
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column(
"links",
"url",
existing_type=sa.Text(),
type_=sa.VARCHAR(length=255),
existing_nullable=False,
)
# ### end Alembic commands ###

0 comments on commit 24442c8

Please sign in to comment.